0

I have a very basic question regarding DNS resolution rules.

Let's say that I my domain name is mydomain.parentdomain.com and I am having bind config (very stripped one):

               NS       ns.parentdomain.com

ORIGIN mydomain.parentdomain.com.
@              A        XXX.XXX.XXX.XXX
www            CNAME    mydomain.parentdomain.com.

Given the case above, I have some questions (more of assumptions) to which I don't know the answers:

  1. user visiting either www or non-www would resolve the IP. Correct?

  2. if I remove both A and CNAME, users would not be able to resolve and would fallback to ns.parentdomain.com for resolution attempt. In my case, ns.parentdomain.com would have no idea about my domain, so no resolution would be possible. Correct?

  3. Finally, leaving A and CNAME removed, but swaping my NS for CloudFlare NS, (it has a complete DNS configuration, all domains and subdomains), would this still work? I guess, the question is, would my original DNS server fallback to CloudFlare NS at all? If this is true, would this mean that I deferred a resolution completely to CloudFlare?

If I wasn't very clear or did leave some blanks in my question, please ask away in the comments :)

Jovan Perovic
  • 123
  • 1
  • 3
  • 13

1 Answers1

2

I will replace parentdomain.com with example.com which is reserved for documenting cases like this.

  1. Only mydomain.example.com and www.mydomain.example.com will resolve. non-www.mydomain.com will not resolve as it isn't defined.
  2. Unless example.com designates other name servers for mydomain.example.com, its name servers will be used to resolve mydomain.example.com. Unless the domain is misconfigured there will be at least two name servers such as ns1.example.com and ns2.example.com. However, the name server could just as well belong to another domain such as ns1.example.net and ns2.example.net. (Note: .net rather than .com.) The NS record you have is redundant and likely incorrect.
  3. Just configuring CloudFlare or any other name server will not work. In this case example.com would need NS records for mydomain.example.com pointing to the CloudFlare name servers.

With no cached records the search will follow this order:

  • Ask a root server for www.mydomain.example.com which will return the nameservers for com.
  • Ask a com nameserver fo www.mydomain.example.com which will return the name servers for example.com.
  • Ask an example.com nameserver for www.mydomain.example.com which will return data for www.mydomain.example.com.

If mydomain.example.com has been delegates other nameservers such as CloudFlare replace the last step with.

  • Ask an example.com nameserver for www.mydomain.example.com which will return nameservers for mydomain.example.com.
  • Ask an mydomain.example.com nameserver for www.mydomain.example.com which will return data for www.mydomain.example.com.
BillThor
  • 27,354
  • 3
  • 35
  • 69