Get Domain IP Address: Four Answers for One Name

A domain name does not have an IP address. It has a record set, and which rows of that set you receive depends on the resolver you ask: the zone publishes the records, the resolver decides how many to hand over, from which cache, and how stale.

Fifty domains were asked at the apex and at www through four public resolvers from one browser, 400 queries with no failures. The four answers were identical for 39 of the 50 apex names and for 24 of the 50 www names; in 25 of the www cases the four sets shared no address at all.

Type a domain to run the same four queries yourself.

Fifty domains, four resolvers. Half the www names came back as four sets with nothing shared.

measured

Record board

One name, four resolvers, and every address each of them returns.

Record board
ResolverAddressesIPv6TTLTime

The CNAME chain appears here when the answer begins with one.

Waiting for the first name.
Run a lookup to produce a copyable result.

Four public resolvers are queried over DNS-over-HTTPS: AliDNS, dns.google, Cloudflare and dns.sb. A fifth query asks a random label under the same zone, so a wildcard that answers unknown names is visible instead of silent. The TTL is the seconds left on the record the resolver handed back, not the value set in the zone. Nothing you type is stored or sent anywhere else.

What the query returns, and what it does not

Three record types answer a request for an address, and only one of them holds an address. The other two explain why a lookup can succeed and still not name the machine the browser talks to.

What the query returns, and what it does not
RecordHoldsFrom this run
Aa set of addresses31 for www.ebay.com
AAAAa set of IPv6 addresses4 for google.com, 2 for netflix.com
CNAMEanother name3 hops from www.apple.com to an Akamai edge

A CNAME is why an answer can look wrong and be right. When a name resolves through one, the address at the end belongs to the last name in the chain, not to the name you asked about. Forty of the hundred answers here began with a CNAME and the deepest chain was three hops, ending at e6858.dsce9.akamaiedge.net for www.apple.com and at reddit.map.fastly.net for www.reddit.com. The same split appears one level up: for 28 of the 50 domains, the apex and www returned no address in common.

An empty answer has three shapes, and a tool that prints one blank row hides the difference. A non-existent label under github.com and under cloudflare.com came back NOERROR with nothing in the answer and the zone's SOA in the authority section, which says the name exists and the record does not. bbc.co.uk returned the same question as NXDOMAIN, and so did an unregistered .com, which says the name itself does not exist. Then there is the third shape: taobao.com answered a random label with a four-hop chain and an address, at a different final address for each resolver. A typo can return a live address there, and no error at all.

Four resolvers, one name, four sets

The clearest case in the run is www.ebay.com, because every resolver followed the same three-hop chain and then parted ways at the last step. The chain, character for character, was www.ebay.com to www.ebay.com.ebaycdn.net to slot88167.ebay.com.edgekey.net to e88167.a.akamaiedge.net. The address sets behind that shared name had nothing in common.

Four resolvers, one name, four sets
ResolverOne address of the setCountTTL
AliDNS23.55.143.13296 s
dns.google23.35.148.9820 s
Cloudflare23.210.7.795 s
dns.sb23.200.143.70520 s

Thirty-one addresses, four groups, zero overlap. The name was identical, the chain was identical, the minute was identical, and the four answers could not be reconciled. It is not an eBay peculiarity: google.com at the apex returned one address to two resolvers, a second address to a third, and six addresses from a separate range to the fourth; www.reddit.com reached reddit.map.fastly.net at all four and then landed in three different Fastly ranges; www.taobao.com returned 155.102.181.x to three resolvers and 43.109.163.x to the fourth.

The counter-example matters as much. socks5.io and rola-ip.co returned the same two addresses to all four resolvers, because both sit behind a single anycast network with no geography in its answers, and github.com returned one address everywhere. The difference between those two groups is not the size of the site. It is whether the zone answers with geography at all, which is a setting the operator chose and nobody outside can see.

The TTL is a countdown, and the record moves

Every record carries a TTL, and the number you see is what remains of it rather than what the zone set. To check that, each zone's own name server was queried directly and its answers compared with the four resolvers. Over 127 records the authoritative TTL ran from 20 to 3600 with a median of 300, and 49 of the 127 were at or below 60 seconds.

Against that baseline, dns.sb returned the authoritative value 91 times in 100, dns.google 44 times in 96, AliDNS 32 times in 101 and Cloudflare 15 times in 98, with a median lag of 50 seconds. The tail is easier to read than the median: mozilla.org carries 600 seconds and AliDNS returned 1, one second from expiry; github.com carries 60 and the four resolvers returned 53, 60, 21 and 60 for the same record at the same moment. A TTL near zero is a cached copy about to be refreshed, not a badly configured zone.

The address itself moves as well. Twelve www names were asked three times, seventy seconds apart: nine of the twelve gained or lost at least one address. www.airbnb.com produced 62 distinct addresses over the three rounds with only 3 common to all of them; www.ebay.com produced 43 with 15 shared. Three names held still, and those three are the ones whose answers carry no rotation at all.

Where a proxy changes which address you get

A resolver answers from where it stands. That is the whole mechanism behind the numbers above, and it is why the same name can hand a different address to a reader in one network than to a reader in another. When the question travels through a proxy, the resolver that answers is chosen by the client, and the two obvious settings do not agree.

With socks5:// the client resolves the name itself and sends the finished address to the proxy. With socks5h:// the name is handed to the proxy and resolved there, inside the exit network. Same command, same target, possibly a different address, and an allowlist keyed on one address can pass in one mode and fail in the other without anything else changing.

That is also why a single saved address ages so badly. www.ebay.com answered with 31 addresses spread over four groups and a TTL between 5 and 20 seconds; www.airbnb.com produced 62 addresses in under three minutes. If a rule has to survive, key it on the name or on the network range rather than on one row of one answer, and confirm it from the exit you will actually browse from rather than from your desk.

Questions this test answers

How do I get the IP address of a domain?

Query the A record, and accept that the reply is a set rather than a value. Across 100 names the median answer was two addresses and the largest was 31, for www.ebay.com. The command is dig +short A example.com. Which of those addresses you receive depends on the resolver you ask, because the zone hands a different slice to each network.

Why does the same domain give a different IP address each time?

Two reasons, both measurable. The resolver picks from a rotating pool, so a second query a minute later can return a different member: nine of twelve www names changed inside 140 seconds, and www.airbnb.com produced 62 addresses of which 3 were common to all three rounds. And the answer is chosen by where the resolver sits, so a resolver in one network returns a different edge than a resolver in another.

What is the difference between an A record and a CNAME?

An A record holds an address, a CNAME holds another name. When a name is a CNAME the address in the answer belongs to the last name in the chain, not to the one you asked about. In this test 40 of 100 answers began with a CNAME and the deepest chain was three hops, ending at an Akamai edge name for www.apple.com and at reddit.map.fastly.net for www.reddit.com.

Does every domain have an IPv6 address?

No. Thirty-two of the fifty domains returned an AAAA record and eighteen returned none, so an AAAA lookup that comes back empty says nothing about whether the site works over IPv6. The record can also be uneven between resolvers: the AAAA count for the apex of weibo.com was two, zero, two and two across the four resolvers asked.