$ORIGIN example.com. ; not necessary, using this to self-document
$TTL 3600
@ IN SOA ns1.example.com. admin.example.com. (
1970010100 7200 1800 1209600 300)
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
@ IN A 198.51.100.1
ns1 IN A 198.51.100.2
ns2 IN A 198.51.100.3
sub1 IN NS ns1.example.edu.
sub2 IN NS ns1.sub2
ns1.sub2 IN A 203.0.113.1 ; inline glue record
The role of a NS record beneath the apex of a domain is well-understood; they exist to delegate authority for a subdomain to another nameserver. Examples of this above would include the NS records for sub1
and sub2
. These allow the nameserver to hand out referrals for portions of the domain that it does not consider itself authoritative for.
The purpose of the NS records at the apex of a domain, ns1
and ns2
in this case, seem to be less understood by the internet at large. My understanding (which may not be holistic) is as follows:
- They are not used by caching DNS servers in order to determine the authoritative servers for the domain. This is handled by nameserver glue, which is defined at the registrar level. The registrar never uses this information to generate the glue records.
- They are not used to delegate authority for the entire domain to other nameservers. Trying to do so with software such as ISC BIND will not result in the "expected" referral behavior at all, as the nameserver will continue to consider itself authoritative for the zone.
- They are not used by the nameserver to determine whether it should return authoritative responses (
AA
flag set) or not; that behavior is defined by whether the software is told to be a master or a slave for the zone. Most nameserver software will quite happily serve apex NS records that disagree with the information contained by the upstream glue records, which will in turn cause well-known DNS validation websites to generate warnings for the domain.
With this being the case, what are we left with? Why are we defining this information if it doesn't appear to be consumed by caching DNS servers on the internet at large?