Search code examples
dnsnameservers

Do I need nameserver records that point to my own nameserver?


I recently bought a domain name from a registrar, and I rerouted the nameserver records to my hosting provider's nameservers, where all my DNS records are.

By default, my hosting server's DNS records have NS entries that point back to itself, i.e.

NS -> ns1.example.com
NS -> ns2.example.com
NS -> ns3.example.com

These are the same records that I use on my registrar to point to my hosting server's nameservers. Is it safe to remove these records, and leave only the relevant A, CNAME, MX, etc. records that I need?


Solution

  • It's NOT safe!

    The NS records are mandatory records, if you are able to delete them the DNS server may (and most probably will) refuse to load the new version of the DNS zone, meaning the will still be in the zone file and when the server is restarted the zone file will not be loaded, since it's broken. Here is an output of a DNS zone file check:

    # named-checkzone example.com /root/example.com
    zone example.com/IN: has no NS records
    zone example.com/IN: not loaded due to errors.