DNS – When Are Glue Records Needed?

domaindomain-name-systemglue-recordhosting

I kind of know why glue records are needed (cyclic dependencies), but when are they needed? Are they only needed when setting a domain's nameservers to my own machine on the internet – like "ns1.mydomainonmyserver.com" ??

Is there any need / point in making glue records when using external / hosting provider's nameservers?

Best Answer

You only need glue records when the hostname for your nameserver is part of the same domain as it's trying to serve.

Glue records are published in the parent zone. Hence if the operator of example.com wanted to have nameservers named ns1.example.com and ns2.example.com then the .com domain would need something like:

example.com.     IN NS ns1.example.com.
                 IN NS ns2.example.com.
ns1.example.com. IN A  192.0.2.1
ns2.example.com. IN A  198.51.100.5

(example subnets taken from RFC 5737).

The child zone would usually have the same A records in it (even if only for consistency), but when they're in the child zone they're not technically glue records any more.