DEV Community

Cover image for What are Glue Records?
Firat
Firat

Posted on • Originally published at dumpbox.net

What are Glue Records?

Understanding Glue Records in DNS

Glue records are special DNS records that resolve a "chicken and egg" problem in the Domain Name System (DNS). They are essentially IP addresses for name servers that are part of the same domain, published in the parent zone or by the domain registrar.

How Domain Name System (DNS) Works

When you type a domain name into your web browser, the DNS system translates that domain name into an IP address that computers use to identify each other on the network. This translation is done by querying a series of DNS servers, starting from the root servers down to the authoritative name servers for the domain.

All domain names must have at least two name servers for redundancy and reliability. These name servers are typically specified in the domain's DNS records. But if you want to use name servers that are part of your own domain (e.g., ns1.yourdomain.com and ns2.yourdomain.com), you need glue records to ensure that the DNS resolution process can find these name servers. Otherwise, the DNS resolver would try to resolve the name server's domain name, looking for the name server itself, leading to a circular dependency.

  • DNS resolver looks up yourdomain.com
  • It query the parent zone (e.g., .com) for the name servers of yourdomain.com
  • The parent zone responds with ns1.yourdomain.com and ns2.yourdomain.com
  • Along with the name servers, the parent zone also provides glue records (IP addresses) for ns1.yourdomain.com and ns2.yourdomain.com
  • The DNS resolver can now directly contact ns1.yourdomain.com and ns2.yourdomain.com using the provided IP addresses to get the DNS records for yourdomain.com

Use Cases for Glue Records

Glue records are typically used in the following scenarios:

Hosting Your Own Name Servers: If you want to run your own DNS servers for your domain, you will need glue records to ensure that other DNS resolvers can find your name servers.
Subdomains as Name Servers: If you want to use subdomains of your main domain as name servers (e.g., ns1.subdomain.yourdomain.com), glue records are necessary to avoid circular dependencies.

Conclusion

Glue records are essential for the proper functioning of DNS when using name servers that are part of the same domain. They help resolve circular dependencies and ensure that DNS resolvers can find the necessary name servers to translate domain names into IP addresses. If you plan to host your own name servers or use subdomains as name servers, make sure to set up glue records with your domain registrar.

Top comments (0)