Table of Contents
You type bbc.co.uk into the address bar and the homepage appears before your finger leaves the trackpad. In that half-second, your device asked a chain of servers scattered across several continents which machine should answer you, and they all agreed. That chain is DNS, and it is the single most invisible piece of infrastructure in your daily life.
What DNS actually is
DNS stands for Domain Name System. It is a globally distributed database whose one job is translating human-friendly names into the numeric IP addresses that routers understand. Nobody memorises 151.101.1.140. We remember bbc.co.uk, and DNS closes the gap.
The system has been running since 1983, when Paul Mockapetris designed it to replace a flat text file called HOSTS.TXT that a handful of Stanford researchers kept manually syncing between machines. That file stopped scaling somewhere around a few hundred computers. Today the same basic design handles roughly 360 million registered domain names and trillions of lookups a day.
Two things make it work at that scale. It is hierarchical, so no single server knows everything, and it is heavily cached, so most answers never travel far at all.
The lookup, step by step
Say you request example.com on a laptop that has never visited it before. Here is the actual sequence.
1. Your device checks what it already knows
The operating system checks its local cache, and the browser checks its own separate cache. If either holds a valid, unexpired answer, the lookup ends there in under a millisecond. This is why a site you visit daily feels faster than one you don’t.
2. A recursive resolver takes over
If nothing is cached locally, your device asks a recursive resolver, usually run by your ISP, your company, or a public service such as Cloudflare at 1.1.1.1 or Google at 8.8.8.8. The resolver is the workhorse. It does the legwork so your laptop doesn’t have to.
3. Root servers point the way
The resolver asks a root server. There are 13 logical root servers, labelled A through M, but they run on more than 1,700 anycast instances worldwide, so the nearest one is usually a few milliseconds away. The root doesn’t know example.com’s address. It knows who runs .com, and says so.
4. The TLD server narrows it down
The resolver then queries the .com name servers, operated by Verisign. Those respond with the authoritative name servers for example.com, typically something like ns1.example.com.
5. The authoritative server gives the answer
Finally, the resolver asks the authoritative server, which is the one place that actually holds the record. It returns the IP address, the resolver passes it to your device, and the connection to the web server begins. Your browser then loads HTML, CSS, images and scripts, each of which may trigger further DNS lookups for other hostnames.
All of this normally takes 20 to 120 milliseconds. The first time. Every subsequent request inside the record’s time-to-live window is answered from cache.
The record types that do the real work
A domain’s DNS zone is a set of records, each with a type. A handful of them cover almost everything you’ll ever touch:
- A record — maps a name to an IPv4 address, such as 93.184.216.34.
- AAAA record — the same for IPv6.
- CNAME — an alias pointing one name at another, common for www and for pointing a subdomain at a hosting provider.
- MX — tells the world which servers accept email for your domain, with a priority number for failover.
- TXT — free-text records used for domain ownership verification and for SPF, DKIM and DMARC, which decide whether your email is trusted.
- NS — names the authoritative name servers for the zone itself.
- SOA — administrative metadata, including the serial number that secondaries use to detect changes.
Get the MX records wrong and email silently disappears. Get the CNAME pointing at a decommissioned host and a chunk of your site 404s. Most DNS incidents are not attacks. They are typos in a control panel.
TTL, caching and why changes take so long
Every record carries a TTL, or time to live, measured in seconds. A TTL of 3600 means resolvers may cache that answer for an hour. A TTL of 300 means five minutes.
This is the number that causes the most frustration in web operations. If you migrate a site to a new server and the old record had a 24-hour TTL, some visitors will keep hitting the old machine for a full day, because their resolver is doing exactly what you told it to. The standard trick is to lower the TTL to 300 seconds a day or two before the migration, make the change, then raise it again afterwards. Short TTLs cost you a little extra query traffic. Long TTLs cost you agility when something breaks at 2am.
DNS is also a security surface
Because nearly every connection starts with a lookup, DNS is an attractive target. Three problems come up repeatedly.
Spoofing and cache poisoning
Traditional DNS queries travel unencrypted over UDP port 53. An attacker who can intercept or forge those packets can hand your resolver a false answer and send you to a convincing copy of your bank’s login page. DNSSEC addresses this by cryptographically signing records, so a forged answer fails validation. Adoption is patchy but growing, and it is worth checking whether your registrar and DNS host support it.
Eavesdropping
Plain DNS also leaks your browsing history to anyone on the path, including public Wi-Fi operators. DNS over HTTPS and DNS over TLS wrap queries in encryption, which is why most modern browsers now use encrypted DNS by default.
Being the control point
Filtering at the DNS layer is efficient. Block a malicious domain once and every device on the network is protected before a single packet reaches the attacker. Many organisations pair that with identity-aware access controls, the same principle behind the zero trust platforms that gate access by user and device rather than network location. DNS filtering decides what you can reach; zero trust decides who you are. Together they close a lot of gaps that a firewall alone misses.
When DNS breaks, here’s how to prove it
The symptom is usually vague: “the internet is down.” Your first job is to find out whether it is DNS or something else. Try loading a site by IP address instead of name. If the IP works and the name doesn’t, you have a DNS problem.
From there, a few commands settle it fast. On Windows, nslookup example.com; on macOS or Linux, dig example.com or host example.com. Query the authoritative server directly by adding @ns1.example.com to see whether the record exists at source or is being mangled in transit. Compare that to what a public resolver returns. If they disagree, caching or propagation is the culprit.
Common failure signals are worth recognising. NXDOMAIN means the name does not exist, so check your spelling or your record. SERVFAIL usually points to a broken delegation or a DNSSEC validation failure. Timeouts suggest the name server is unreachable, often because a firewall blocks port 53 or the provider is having an outage.
On the client side, flushing the local cache clears a surprising number of problems. It is ipconfig /flushdns on Windows, sudo dscacheutil -flushcache on macOS, and restarting the resolver service on Linux. If a single machine is affected while others on the same network are fine, the local cache is almost always the reason.
A short hygiene routine worth adopting
Most DNS pain is preventable with a little housekeeping. Confirm you have at least two authoritative name servers on separate networks, because a single one is a single point of failure for your entire domain. Keep an eye on expiry dates, since an expired domain takes email and website down together and recovery can take days. Enable DNSSEC if your provider supports it. Turn on registrar lock to make hijacking harder. And record your TTL values somewhere, because the person debugging a migration six months from now will want to know why changes aren’t showing up.
None of this is glamorous work. But DNS is the layer everything else sits on, and the organisations that treat it as real infrastructure rather than a one-time setup step are the ones that don’t vanish from the internet because someone fat-fingered a nameserver entry on a Friday afternoon.


