DEV Community

Pieter D
Pieter D

Posted on • Updated on

When does your domain name need glue records?

Let's say you own example.com, and you want to host your name servers at ns1.example.com and ns2.example.com.

When a DNS client looks up ns1.example.com, the root servers would tell the client to ask the name servers of the .com TLD, which would tell it to ask the name servers of example.com. Hmm. You need to ask the example.com name servers where the name servers of example.com are.

See the chicken-and-egg problem? It's a maze without an exit. But you can create one - if you provide glue records. Basically, you have to ensure the TLD's name servers reveal your own name servers' IP addresses through additional DNS records. Here's an animated video that explains how it works.

Are glue records dangerous?

When used incorrectly, glue records may cause your website to become unreachable. In essence, you're asking your TLD's name servers to cache the IP address translation of your name servers. If you rely on a third-party DNS service like CloudFlare for your domain's name servers, their IP addresses can change at any time without your knowledge.

If you're using ruth.ns.cloudflare.com and west.ns.cloudflare.com as your name servers, and you pushed glue records for them, your website may become unavailable if at least one of its name servers gets a new IP address.

Long story short: glue records are a crucial element of DNS, but only use them when strictly necessary. Be aware that you will need to accommodate any IP address changes in your glue records to ensure your website remains available.

Top comments (0)