Why can one domain name resolve to several IP addresses?¶
title: "Why can one domain name resolve to several IP addresses?" card_id: "IP-039" status: "complete" source_document: "https://docs.google.com/document/d/1s-OM2FSY09qdUv1S0KTxoKJOxGRr4fO10JVDWPF9les/edit?usp=drivesdk"
Why can one domain name resolve to several IP addresses?¶
A DNS lookup for one domain name may return several different IP addresses.
That doesn't necessarily mean that the DNS records are wrong or that several unrelated services are involved.
Large online services rarely depend on one server with one address.
They may operate many servers so that traffic can be distributed between them. If one becomes busy or unavailable, users can be directed towards another.
This is called load balancing.
DNS can support this by publishing several A or AAAA records for the same name. A resolver may return the complete set of addresses, while the device or application decides which one to try.
The order of the addresses may also change between queries.
A service may use different addresses for resilience. If one system or data centre fails, the DNS answer can be changed so that users are directed towards working infrastructure elsewhere.
Content-delivery networks create another reason.
A content-delivery network, or CDN, operates servers in many different locations. It can direct users towards infrastructure intended to provide the service efficiently from their part of the world.
Someone querying the domain in the UK might therefore receive a different address from someone querying it in Australia.
The answer may also depend on which DNS resolver made the query, the condition of the service at that moment or decisions made by the service’s traffic-management systems.
A domain might also publish both IPv4 and IPv6 addresses.
Those addresses may provide two different network routes to the same underlying service rather than representing separate websites.
Some services use anycast, where the same IP address is announced from several physical locations. In that situation, even one returned address doesn't necessarily identify one particular server or country.
DNS answers can change over time as well.
An address observed during a lookup today may not have been returned at the time of the event being investigated. Equally, an address recorded during the event may no longer appear in the current DNS records.
Finding several addresses for one domain doesn't prove that every address was used during a particular connection.
The actual destination should come from the original network, platform or device record where possible.
A domain name can represent a service spread across many systems and locations. DNS provides a route towards that service, but it doesn't guarantee one permanent name-to-one-address relationship.