windowsdnshostnamefqdn

DNS configuration adding New Host(A or AAAA) and New Alias(CNAME)


My provider shared me a document link about how to configure Dns and the document stated that i must add New Host(A or AAAA) like this:

Hostname:ns1
FQDN:ns1.domain.com
IP: 192.168.1.2 <= for example

And New Alias(CNAME) Like this:

Hostname: www
FQDN: www.domain.com
FQDN for target host: domain.com

i did what it mentioned. but website never showed up although it was searchable through ip address and ns1.domain.name.moreover,i read other websites guidelines and they also stated what document did. After a lot of efforts, i couldn't solve the problem that, why website doesn't resolve while i search domian.com or www.domain.com in chrome. So i tried to change every thing and tried below settings and it WORKED !.now the website can be searched in both domain.com and www.domain.com

Add New Host(A or AAAA)

Hostname:www
FQDN:www.domain.com
IP: 192.168.1.2 <= for example

Recently, i read this website which says

DNS Propagation- DNS changes to a domain may require 4-24 hours of domain propagation before the change is recognized on the internet. If you have made a change which affects an IP assignment (e.g. A record), then you will need to allow for the propagation time to complete before it is recognized on the internet.

it means New Host(A or AAAA) needs time to Propagation.is it correct? if yes why do my settings affect instantly ?

I need a clear answer around this question topic . all others tell i must have CNAME but my settings solve my problem. what's wrong here?

i am using Windows Server 2016


Solution

  • That propagation article is misleading: when clients resolve hostname to ip address, they cache the resolved value for some time (TTL, and that value you set when you create a DNS record), so they don't have to resolve it for each subsequent request.

    So, when you change DNS record value, clients will not be immediately aware of it because they are using the cached value, until TTL expires.

    When you create a new record, there is nothing cached on client side so there is nothing to wait for!

    About DNS records, it is difficult to say why your provider's instructions mention ns1 hostname, that you will need to check with them.

    About A and CNAME (in somewhat layman's terms):

    Clients (your site visitors' devices) need to know the ip address for a hostname they are trying to access. That is the purpose of A record: when you create www A x.y.z.w that tells your client that x.y.z.w is the ip address of www.example.com. Nothing more, nothing less, but it is necessary!

    CNAME is just alias (another hostname) for the hostname that you already defined in A record. So, website CNAME www.example.com means that website.example.com has the same IP address as www.example.com. When you, sometime in the future, change the ip address of www.example.com, there will be no need to update website, it will also immediately point to new ip address, because it is just alias of www.example.com. Technically you could also create an A record for website, with address x.y.z.w and it would have the same effect, except that if you ever need to update ip address in the future, you will need to update two A records.