The mystery of DNS
How does your computer find a website?
When you type a website's address in the browser - for example www.example.com - your computer does not understand that name at all. For it, communication happens only through numeric addresses, called IP (Internet Protocol) addresses, such as 192.0.2.1 or 2001:db8::1 in the case of IPv6. The DNS (Domain Name System) is the mechanism that translates these readable names into numbers, allowing devices to correctly locate the server hosting the site.
How it works technically
DNS is a hierarchical, distributed network of servers that cooperate to resolve requests. When you type an address in the browser, a sequence of operations takes place:
- Initial request: the browser asks the operating system for the IP address matching the domain name.
- Local cache: if the computer has already visited that site, the answer can arrive immediately from the local DNS cache.
- Resolver: if it is not in the cache, the request is forwarded to the DNS server configured in the network (often that of the provider or of public services such as Cloudflare or Google).
- Recursive query: the resolver contacts the authoritative DNS servers, starting from the root servers, passing through the TLD servers (Top Level Domain, such as .com, .it, .org) and finally reaching the server of the specific domain.
- Response: the resolver receives the IP address and returns it to the browser, which can finally open the TCP or HTTPS connection to the correct server.
This whole process takes place in a few milliseconds, invisible to the user but essential for every single web page loaded.
Caching and performance
To avoid constantly repeating the same requests, DNS uses a temporary cache system. Every DNS record has a parameter called TTL (Time To Live), which indicates how long the answer can be considered valid. When the TTL expires, the entry is removed and the resolution must be redone from scratch.
This mechanism reduces traffic and speeds up browsing, but it can cause delays in the propagation of changes: if a site changes server, the old records may remain cached for hours or days.
Types of DNS records
DNS does not only manage IP addresses. There are several types of records, each with a specific function:
| Type | Function | Example |
|---|---|---|
| A | Maps a name to an IPv4 address | example.com → 192.0.2.1 |
| AAAA | Maps a name to an IPv6 address | example.com → 2001:db8::1 |
| CNAME | Alias of another domain | blog.example.com → example.com |
| MX | Mail servers | example.com → mail.example.com |
| TXT | Text information (SPF, verifications) | v=spf1 include:_spf.example.com |
If one site is unreachable while others work, the problem is often not the Internet connection but a DNS malfunction. The resolver may be slow, overloaded or return wrong answers.
In these cases, changing the DNS servers in the network settings can quickly solve the problem. Here are some examples of reliable public servers:
| Provider | IPv4 | IPv6 |
|---|---|---|
| Cloudflare | 1.1.1.1 | 2606:4700:4700::1111 |
| Google DNS | 8.8.8.8 | 2001:4860:4860::8888 |
| Quad9 | 9.9.9.9 | 2620:fe::fe |
DNS was designed in the 1980s and is still one of the pillars of the Internet today. In recent years it has evolved with more secure protocols such as DNS over HTTPS (DoH) and DNS over TLS (DoT), which encrypt requests to prevent interception or manipulation by third parties.
In short
DNS is the “phone book” of the Internet, but with a distributed, resilient structure optimized for speed and security. Without it, typing a domain name would lead nowhere: the browser would not know which “number” to call.
