Search code examples
dnszone

Best practice for a zone name server


I am looking at the DNS setup for a company, call them bar.com. They have a zone file for a subdomain, so foo.bar.com has a few bind servers; so far so good. The thing that strikes me as strange is that the NS record for foo.bar.com points at ns.foo.bar.com. That seems weird to me - the authoritative name servers for a zone are contained within the zone itself. That feels like a snake eating its own tail, the sort of thing that could end badly. Is that standard practice or is it indeed weird? The setup, for clarity:

NS record for foo.bar.com -> ns.foo.bar.com
A record for ns.foo.bar.com -> IP of ns1.foo.bar.com
A record for ns.foo.bar.com -> IP of ns2.foo.bar.com
A record for ns.foo.bar.com -> IP of ns3.foo.bar.com

Solution

  • This is a standard practice. Many large online businesses have their own nameservers delegated in this way. When registering a domain you can choose to set the nameservers to hostnames from another domain (a public DNS provider) or you can set them to names inside your domain. When registering with nameservers as part of the domain you must also specify the IP address of the nameservers as glue records (A or AAAA records created in the parent zone). These records are returned in the ADDITIONAL section of the dns response from the parent zone. This allows a resolver to find your nameservers and then query your records.