Skip to content
IP-036 IP Addresses & Networks

What happens when a device looks up a domain name?


title: "What happens when a device looks up a domain name?" card_id: "IP-036" status: "complete" source_document: "https://docs.google.com/document/d/1M8ndc8f7fWCDjncVMPSh_D8oSNPo5ZTaeijiLS8mDQI/edit?usp=drivesdk"


What happens when a device looks up a domain name?

Suppose somebody enters ifdigital.co.uk into a web browser.

Before the browser can contact the website, the device needs to find an IP address associated with that name.

The first step may not involve sending anything across the internet.

The browser or operating system may already have a recently obtained answer stored in a cache. The device may also have a locally configured entry telling it which address to use.

If no suitable local answer exists, the device sends a DNS query to its configured DNS resolver.

That resolver might be operated by the internet provider, workplace, mobile network or a public DNS service. A home router may also receive the query and pass it to another resolver.

The query effectively asks:

“What information do you have for this domain name?”

The resolver checks its own cache.

If it already has a valid answer from an earlier lookup, it can return that answer without repeating the entire process.

If it doesn't have the answer, it may need to find the servers responsible for the domain.

DNS is organised as a hierarchy.

The resolver can begin with the DNS root system. The root doesn't normally provide the final IP address. Instead, it directs the resolver towards the servers responsible for the relevant top-level domain, such as dot UK or dot com.

The top-level-domain servers can then direct it towards the authoritative DNS servers for the particular domain.

Those authoritative servers hold the DNS records published for that domain.

The answer may provide an IPv4 address, an IPv6 address or an alias that requires another DNS lookup before the final address is obtained.

The resolver returns the result to the device and may cache it so that future queries can be answered more quickly.

The browser can then use the returned IP address to attempt a separate network connection to the service.

That distinction matters.

A DNS lookup is part of finding a service. It isn't the connection to the service itself.

A device might request a DNS answer but never establish a connection. Equally, it may connect without performing a new lookup because the answer was cached or the address was supplied directly.

Different devices may also receive different answers for the same name. Services can use several IP addresses, content-delivery networks or location-based responses.

The lookup process therefore takes a human-readable name, follows the DNS system where necessary and returns information the device can use.

It helps the device find the destination. It doesn't, by itself, prove what happened after the answer was received.


Keep moving

Where this question leads

These links explain why the next page may matter, rather than presenting an undifferentiated list.