I'd like to create a sub-domain, like sub.example.com
.
I have already configured example.com
with NS
"glue" records to point to the DNS server which will manage the sub-domain. They look like:
sub IN NS other.dns.server.example.com.
Where do I put the A
record for sub.example.com
?
Do I put it on the DNS server for example.com
like:
sub IN A 192.168.0.1
Or do I put it in the DNS server for the sub-domain (in my example, other.dns.server.example.com
), like:
@ IN A 192.168.0.1
Or should I put it in both?
I've tried different combinations already, but I want to know what the right way to do it is.
Best Answer
You must put the A record for the subdomain in the domain's records if it does not have any NS records.
You must put the A record for the subdomain in the domain's records if it is a nameserver for itself. (Otherwise, you have a chicken and egg problem.)
You may put the A record for the subdomain in the domain's records even if neither of the first two conditions apply. This has the advantage of saving clients who just need the A record from having to query the subdomain's nameservers, though they may ignore it anyway.