How to Find the IP Address of a Website

RSS

Finding a website's IP address comes down to resolving its domain name through DNS: run nslookup example.com, dig +short example.com or ping example.com, or just paste the domain into an online DNS lookup. Large sites will often hand different addresses to different people — CDNs, load balancers and geo-aware DNS are all busy routing you to whichever server suits you best.

Every website you've ever visited was reached through an IP address — the domain name is really just a label that DNS translates into one or more of them behind the scenes. This guide walks through the fastest ways to get that answer on any operating system, how to actually read the output once you have it, and why the number on your screen might not match what your colleague sees.

The quickest methods at a glance

MethodCommand or stepWorks on
Online lookupEnter the domain in our DNS lookup toolAny device with a browser
nslookupnslookup example.comWindows, macOS, Linux
digdig +short example.commacOS, Linux (Windows with BIND tools)
PowerShellResolve-DnsName example.comWindows
pingping example.comEverywhere
Browser developer toolsNetwork tab, select a request, look for "Remote Address"Chromium-based browsers

Finding a website's IP from the command line

nslookup (Windows, macOS, Linux)

nslookup comes installed just about everywhere, and it queries whatever DNS resolver your system is configured to use:

C:\> nslookup example.com
Server:   router.home
Address:  192.168.1.1

Non-authoritative answer:
Name:    example.com
Addresses:  2001:db8::10
            203.0.113.10

That first block is just the resolver that answered — often your own router. "Non-authoritative" sounds alarming but isn't: it simply means the answer came from a cache rather than straight from the domain's own name servers, which is completely normal. The addresses listed under the domain name are the website's IPv6 and IPv4 addresses.

Want to ask a specific public resolver instead of your own? Tack it on the end: nslookup example.com 1.1.1.1.

dig (macOS and Linux)

dig hands you more control and cleaner output. Add +short and it prints only the answers, nothing else:

$ dig +short example.com
203.0.113.10

$ dig +short AAAA example.com
2001:db8::10

$ dig +short www.example.com
example.com.
203.0.113.10

That last example is showing you a CNAME: www.example.com is just an alias pointing at example.com, and it's that domain which actually holds the A record. Lots of sites use CNAMEs this way to point at a CDN or hosting platform, which is why the first line of output is a hostname rather than a plain IP. Run the full dig example.com (skip the +short) and you'll also see the record's TTL — the number of seconds resolvers are allowed to cache that answer before asking again.

Query a particular resolver directly with dig @8.8.8.8 +short example.com. Comparing two resolvers side by side is a quick way to catch a recent DNS change that hasn't reached every cache yet.

Resolve-DnsName (Windows PowerShell)

PS> Resolve-DnsName example.com -Type A

Name          Type   TTL   Section    IPAddress
----          ----   ---   -------    ---------
example.com   A      300   Answer     203.0.113.10

Swap in -Type AAAA for IPv6, and add -Server 1.1.1.1 if you want to query a specific resolver.

ping

Ping has to resolve the name before it can send any packets, so the very first line gives the address away:

$ ping -c 1 example.com
PING example.com (203.0.113.10): 56 data bytes

On Windows, run ping -4 example.com to force IPv4, since Windows reaches for IPv6 first whenever it's available. Keep in mind ping only ever shows one address even when the name has several, and plenty of servers block ICMP outright — so "Request timed out" doesn't mean the site is down. All it really tells you is that the name resolved. For reading the rest of the output, our guide to ping and traceroute covers that in detail.

The system resolver vs DNS tools

Here's a quirk worth knowing: nslookup and dig talk to DNS servers directly and completely ignore your hosts file. ping, browsers and most applications go through the operating system's resolver instead, which checks the hosts file first. On Linux, getent hosts example.com shows you exactly what applications will actually get. So if dig and your browser disagree, look for a hosts file entry, a VPN's DNS settings, or a browser quietly using DNS over HTTPS — one of those is almost always the culprit.

Using an online tool or your browser

No terminal handy — say you're on a phone, or a locked-down work laptop? Use our DNS lookup instead. Enter the domain, pick A for IPv4 or AAAA for IPv6, and the tool queries DNS from our server for you. Since it's resolving from a different network location than yours, its answer can differ from your local one on CDN-hosted sites — which is actually useful information in its own right.

Chrome, Edge and other Chromium browsers will also show you the address the browser actually connected to. Open developer tools (F12), head to the Network tab, reload the page, click the first request, and look for Remote Address under General. This is the most accurate answer for your own connection specifically, because it reflects what really happened — hosts file, DoH resolution, all of it.

What to do with the IP address

  • Find out who hosts the site. Paste the address into our IP lookup and you'll see the network owner, ASN and an approximate location. For a CDN-backed site, though, that will name the CDN itself, not the actual site owner.
  • See the domain's registration. A WHOIS lookup on the domain reveals the registrar and name servers, which often hint at the hosting provider too.
  • Check the hostname behind the IP. A reverse DNS lookup returns the PTR record, if one exists. Caveats on that below.

Why you and someone else may get different IPs

CDNs and anycast

Content delivery networks run servers across many cities at once. Some lean on anycast, where the exact same IP address gets announced from dozens of locations simultaneously, and internet routing just delivers you to whichever one is nearest. Everyone sees the same address in this setup — they just reach different physical machines underneath it. Trying to geolocate such an address won't tell you much; geolocation databases are really just guessing at that point.

Geo-DNS and load balancing

Other providers steer traffic through DNS itself. The authoritative name server looks at where the query came from — either the resolver's address, or the EDNS Client Subnet hint some resolvers pass along — and hands back the address of a nearby or lightly loaded server accordingly. Large sites might also return several A records at once (round-robin) and rotate their order on each query. So running the same lookup twice, or from two different networks, can genuinely produce different results — and every single one of them is correct.

IPv4 and IPv6

A site carrying both A and AAAA records has at least two addresses to its name. Got working IPv6 on your network? Your browser will usually connect over it by default, so the "real" address for your visit might actually be the IPv6 one.

Short TTLs and migrations

When a site changes hosting, resolvers keep serving the old address right up until its TTL runs out. During that window, different people genuinely see different IPs, and nobody's wrong. Our DNS propagation checker queries resolvers all over the world at once, so you can actually watch the change spread in real time.

One IP, many websites

Here's the thing people miss: an IP address doesn't identify a single website at all. On shared hosting, and on every major CDN, thousands of domains can happily share one address. The server decides which site to actually show based on the hostname your browser sends along — the Host header for HTTP, the SNI field in the TLS handshake for HTTPS. That's exactly why typing a site's IP address straight into the address bar often gets you a default page, a certificate warning, or an outright error instead of the site you were after.

That same fact caps what a reverse lookup can actually tell you. The PTR record for a shared address is set by whoever controls the IP block — usually the hosting company or CDN, not the website — so it typically returns something generic like server-203-0-113-10.example.net rather than the site you started looking for. Plenty of addresses have no PTR record at all, in fact. A reverse lookup is good for identifying the network; don't expect it to list every site sitting on it.

Tip: Need to block or allow a website in a firewall? Use its domain name if the firewall supports it. Rules built on a CDN-hosted site's IP addresses break the moment the provider changes them, and can end up affecting every other site sharing those same addresses.

Frequently asked questions

Can I find a website's real server IP if it uses a CDN?

Usually not through DNS alone. The CDN deliberately hides the origin server, and DNS only ever hands back the CDN's own addresses. Historical DNS records or a misconfigured subdomain can sometimes let an origin slip through, but a well-configured site only accepts traffic from its CDN anyway — so that origin address wouldn't be much use to a normal visitor even if you found it.

Why does nslookup show a different IP from ping?

They're probably taking different paths to the answer. nslookup queries a DNS server directly, while ping goes through the system resolver, which checks the hosts file and may prefer IPv6. On load-balanced sites, even two queries a few seconds apart can return different addresses.

Can I visit a website by typing its IP address?

Sometimes, yes. It works when the server hosts only that one site, or treats it as the default. On shared hosting and CDNs it usually fails, because the server needs the hostname to know which site to serve up, and HTTPS certificates are issued for names — never for the bare IP.

Does a website's IP reveal where the company is located?

No. It reveals where the server or CDN edge sits, and often only the network that owns the address at that. A company based in one country routinely hosts in another entirely, and serves visitors from edges scattered everywhere.

Попробуйте сами

Примените это руководство на практике с помощью наших бесплатных инструментов.

Комментарии

Поделитесь советом, задайте вопрос или расскажите, как вам помог инструмент.

Читать далее

Скопировано в буфер обмена