What is DNS – and what happens during a lookup?

How a domain name is turned into an IP address: resolvers, root servers, TLDs, authoritative name servers and caching – explained step by step.

Every time you open a website, send an email or use an app, your device has to find out which IP address belongs to a name such as example.com. The system that answers that question is the Domain Name System – DNS. It is often called the phone book of the internet, but it is really a huge, distributed database where no single server knows everything, and every part of the name is managed by someone different.

The names are read from right to left

A domain name is a list of labels separated by dots. DNS reads them from the right. In www.example.co.uk the hierarchy is:

Each level only knows where to find the level directly below it. This is called delegation, and it is what lets millions of organisations manage their own names without a central bottleneck.

The players in a lookup

Stub resolver. The small DNS client built into your operating system. It does not do any real work itself; it simply asks a recursive resolver and waits for the answer.

Recursive resolver. Usually run by your internet provider, your company, or a public service such as Cloudflare (1.1.1.1), Google (8.8.8.8) or Quad9 (9.9.9.9). It does the legwork of finding the answer, and it keeps a cache of everything it has looked up recently.

Root servers. Thirteen named server sets (a.root-servers.net to m.root-servers.net), operated by twelve organisations and spread over more than a thousand physical locations. They do not know the address of example.com, but they know which servers are responsible for .com.

TLD servers. The servers for .com, .dk, .org and so on. They know which name servers each domain under them has been delegated to.

Authoritative name servers. The servers that actually hold the domain's records – typically run by your DNS host or registrar. Their answer is the truth; everything else is a copy.

Advertisement

A lookup, step by step

Say you type www.example.com into your browser and nobody has looked it up recently:

  1. Your computer asks its recursive resolver: "What is the IPv4 address (A record) of www.example.com?"
  2. The resolver asks a root server. The root server does not know, but replies with a referral: "Ask the .com servers – here are their names and addresses."
  3. The resolver asks a .com server, which replies with another referral: "example.com is handled by ns1.dnshost.net and ns2.dnshost.net."
  4. The resolver asks one of those authoritative servers, which finally answers: "www.example.com has the address 93.184.215.14" – with the authoritative answer flag set.
  5. The resolver gives the answer to your computer and stores it in its cache for as long as the record's TTL (time to live) allows.

The next person using the same resolver gets the answer instantly from the cache, and the resolver also remembers where the .com servers are, so it rarely needs to bother the root servers at all. This caching is what makes DNS fast – and also why DNS changes are not visible everywhere at once. The guide to propagation and TTL explains that in detail.

How webstriker uses this

When you run a lookup on webstriker, the tool plays the part of the recursive resolver itself – but without any cache. It starts at a root server, follows each referral, and ends up at the domain's authoritative name servers. The "Delegation from the root" table at the bottom of the report shows each step: which server was asked, how long it took, and where it pointed next. This is the same thing the command dig +trace example.com shows.

Because the records then come straight from the authoritative servers, you see what the domain's DNS says at this very moment. The report also compares that answer with what several large public resolvers have cached, so you can tell whether a recent change has reached them yet.

Common problems you can spot

Key takeaways

Try it yourself:
Advertisement

More guides