Domains

How DNS resolves a domain name, step by step

Follow a DNS lookup from your browser through the resolver, root servers, TLD servers and authoritative nameservers, and see where caching and TTL fit in.

BeginnerEveryone2 min read

The Domain Name System (DNS) is the internet's directory. Every time you open a website or send an email, DNS turns a name like example.com into the IP address of the right server. A lookup usually takes a few milliseconds because answers are cached at many levels.

Key terms

  • Recursive resolver: the server that does the lookup for you, usually run by your ISP or a public service such as 1.1.1.1 or 8.8.8.8.
  • Root servers: the top of the hierarchy; they know where each TLD is handled.
  • TLD servers: run by the registry, they know the nameservers for every domain in that TLD.
  • Authoritative nameservers: hold the actual records for a domain, for example the MdmHost nameservers for your hosting.
  • TTL: how long an answer may be cached, in seconds.

A lookup, step by step

  1. Local cache: the browser and operating system check whether they already know the address.
  2. Resolver: if not, the computer asks its recursive resolver. If the resolver has a fresh cached answer, it replies at once.
  3. Root: otherwise the resolver asks a root server, which answers "ask the .com servers".
  4. TLD: the .com servers reply with the domain's nameservers, for example ns1.yourhost.com.
  5. Authoritative: the resolver asks those nameservers for the A (or AAAA) record and gets the IP address.
  6. Answer and cache: the resolver returns the IP to your computer and caches it for the record's TTL. The browser then connects to the server.

Note: Email uses the same process but asks for MX records to find the receiving mail server.

Why changes are not instant

Because every resolver caches answers until the TTL expires, a change to your records or nameservers reaches different visitors at different times. See DNS propagation and TTL.

Where you control DNS

Whoever runs your authoritative nameservers holds your records. With MdmHost nameservers, you edit records in cPanel Zone Editor. The difference between nameservers and records is explained in nameservers vs DNS records.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.