Key facts
- A recursive resolver does the lookup work for your device and caches answers.
- Root servers point the resolver to the right top level domain (TLD) servers.
- TLD servers, such as Nominet's for .uk, say which nameservers hold a domain.
- The authoritative nameserver gives the final answer from your DNS records.
- TTL, in seconds, sets how long resolvers may cache each answer.
- Lower a record's TTL, for example to 300, a day or two before a planned change.
The short version
If you want the plain English introduction first, read what is DNS. This guide goes one level deeper and follows a single lookup from start to finish, because knowing the chain makes it much easier to understand why changes take time and where things go wrong.
Four kinds of server take part: the recursive resolver, the root servers, the TLD servers and the authoritative nameservers. Only the last one holds your actual records. The others exist to find it.
Following one lookup
Say a customer types www.example.co.uk into a browser.
- The device asks its resolver. This is usually run by the broadband provider, the office network or a public DNS service. If the resolver already has a fresh answer in its cache, it replies straight away and the lookup ends here.
- The resolver asks a root server. The root servers do not know about example.co.uk. They only know who runs .uk, so they reply with a referral to the .uk servers.
- The resolver asks the .uk TLD servers. Nominet runs these. They do not hold the website address either, but they know which nameservers the domain uses, because that is what was set at the registrar. They reply with those nameservers (plus glue addresses if needed).
- The resolver asks the authoritative nameserver. This server holds the zone for example.co.uk and returns the actual record, for example an A record with the web server's IPv4 address.
- The resolver caches and replies. It passes the answer to the device and keeps a copy for the record's TTL.
A .com lookup follows the same path, with the .com registry's servers in step 3.
Caching and TTL
Every answer carries a TTL (time to live) in seconds. A resolver that has cached a record will keep using it until the TTL runs out, without asking your nameserver again. Referrals are cached too, so a busy resolver rarely needs to ask the root or TLD servers. A "this name does not exist" answer can also be cached for a while, which is why a record added after someone looked it up may not appear for them straight away.
This is the reason DNS changes are not instant. If your A record has a TTL of 3600, some visitors may see the old address for up to an hour after you change it. The fix is planning: lower the TTL to around 300 a day or two before a move, make the change, then raise it again once things are settled.
Where changes actually happen
Knowing the chain tells you where to make each change:
- Changing a record (website address, MX, TXT) happens at the authoritative DNS provider. Only that zone changes, and caches catch up as TTLs expire.
- Changing nameservers happens at the registrar, which updates the TLD servers. This moves the whole zone to a new provider, and the referral itself is cached, so it can take up to 24 to 48 hours to be seen everywhere. See how to change nameservers.
- DNSSEC adds signatures to answers, and a DS record at the registry ties them to the domain. If the DS record does not match the provider's keys, validating resolvers refuse the answer. See DNSSEC.
Most "DNS is broken" problems come down to editing the wrong provider's records, because the nameservers point somewhere else.
How dijitul helps
We set up, change and fix DNS for small businesses, usually in Cloudflare. DNS management is included with dijihost Complete Hosting at £1 a day + VAT. On its own, set-up and changes are £45 an hour + VAT, or a fixed quote for bigger moves. See DNS management and DNS troubleshooting, or ask for a quote.
Frequently asked questions
What is a recursive resolver?
It is the server that does the DNS lookup on behalf of your device. It asks the root, TLD and authoritative servers in turn, then caches the answer. It is usually run by your broadband provider, your office network or a public DNS service you have chosen.
Do root servers know my website's address?
No. Root servers only know which servers handle each top level domain, such as .uk or .com. They send the resolver on to those servers. Your actual records live only on your domain's authoritative nameservers.
Why can a DNS change look different on two devices?
Each device may use a different resolver, and each resolver caches answers for the record's TTL. One may still hold the old answer while another has fetched the new one. Once the TTL has passed everywhere, they will agree.
What TTL should I use?
For records that rarely change, an hour or more is fine and reduces lookups. A day or two before a planned change, lower the TTL to around 300 seconds so the switch is picked up quickly, then raise it again afterwards.
Is DNS the same as nameservers?
Nameservers are part of DNS. They are the authoritative servers that hold your domain's records. DNS is the whole system, including resolvers, root servers and TLD servers. See our guide on what nameservers are for more detail.
Related
Get domains, DNS and email sorted
Set up properly, records checked, and real people to call. DNS and email are included with dijihost hosting.