How to Find the IP Address of a Website

To find a website's IP address, resolve its domain name through DNS: run nslookup example.com, dig +short example.com or ping example.com, or paste the domain into an online DNS lookup. Large sites often return different addresses to different people, because CDNs, load balancers and geo-aware DNS hand out whichever server is best for you.

Every website is reached through an IP address. The domain name is just a label that DNS translates into one or more addresses. This guide shows the fastest ways to get that answer on any operating system, how to read the output, and why the number you see may not be the one 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 is installed almost everywhere and queries your configured DNS resolver:

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

The first block is the resolver that answered (often your router). "Non-authoritative" simply means the answer came from a cache rather than directly from the domain's own name servers; it is normal and not a sign of a problem. The addresses under the domain name are the website's IPv6 and IPv4 addresses.

To ask a specific public resolver instead of your own, add it at the end: nslookup example.com 1.1.1.1.

dig (macOS and Linux)

dig gives more control and cleaner output. +short prints only the answers:

$ 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

The last example shows a CNAME: www.example.com is an alias that points to example.com, which in turn has the A record. Many sites use CNAMEs to point at a CDN or hosting platform, so the first line of output is a hostname rather than an IP. The full dig example.com output also shows the record's TTL, the number of seconds resolvers may cache the answer.

Query a particular resolver with dig @8.8.8.8 +short example.com. Comparing two resolvers is a quick way to spot a recent DNS change that has not 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

Use -Type AAAA for IPv6, and -Server 1.1.1.1 to query a specific resolver.

ping

Ping resolves the name before sending packets, so the first line reveals the address:

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

On Windows, use ping -4 example.com to force IPv4, because Windows prefers IPv6 when it is available. Ping only shows one address even if the name has several, and many servers block ICMP, so "Request timed out" does not mean the site is down. It only tells you the name resolved. Our guide to ping and traceroute covers reading the rest of the output.

The system resolver vs DNS tools

nslookup and dig talk to DNS servers directly and ignore your hosts file. ping, browsers and most applications use the operating system's resolver, which checks the hosts file first. On Linux, getent hosts example.com shows exactly what applications will get. If dig and your browser disagree, a hosts file entry, a VPN's DNS settings or a browser using DNS over HTTPS is the usual explanation.

Using an online tool or your browser

If you cannot open a terminal, for example on a phone or a locked-down work laptop, use our DNS lookup. Enter the domain, choose A for IPv4 or AAAA for IPv6, and the tool queries DNS from our server. Because it resolves from a different network location than yours, its answer may differ from your local one for CDN-hosted sites, which is useful in itself.

In Chrome, Edge and other Chromium browsers you can also see the address the browser actually connected to: open developer tools (F12), go 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 because it reflects what really happened, including any hosts file or DoH resolution.

What to do with the IP address

  • Find out who hosts the site. Paste the address into our IP lookup to see the network owner, ASN and approximate location. For a CDN-backed site, this will name the CDN, not the site owner.
  • See the domain's registration. A WHOIS lookup on the domain shows 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 any. See the caveats below.

Why you and someone else may get different IPs

CDNs and anycast

Content delivery networks run servers in many cities. Some use anycast, where the same IP address is announced from dozens of locations at once and internet routing delivers you to the nearest one. In that case everyone sees the same address, but they reach different physical machines. Geolocating such an address tells you very little; geolocation databases can only guess at it.

Geo-DNS and load balancing

Other providers use DNS itself to steer traffic. The authoritative name server looks at where the query came from, either the resolver's address or the EDNS Client Subnet hint some resolvers send, and returns the address of a nearby or lightly loaded server. Large sites may also return several A records at once (round-robin) and rotate their order. Running the same query twice, or from two networks, can therefore produce different results, and all of them are correct.

IPv4 and IPv6

A site with both A and AAAA records has at least two addresses. If your network has working IPv6, your browser will usually connect over it, so the "real" address for your visit may be the IPv6 one.

Short TTLs and migrations

When a site moves hosting, resolvers keep serving the old address until its TTL expires. During that window, different people genuinely see different IPs. Our DNS propagation checker queries resolvers around the world at once so you can watch the change spread.

One IP, many websites

An IP address does not identify a single website. On shared hosting, and on every major CDN, thousands of domains can share one address. The server decides which site to show based on the hostname your browser sends: the Host header for HTTP and the SNI field in the TLS handshake for HTTPS. That is why typing a site's IP address directly into the address bar often shows a default page, a certificate warning or an error instead of the site you expected.

The same fact limits what a reverse lookup can tell you. The PTR record for a shared address is set by whoever controls the IP block, usually the hosting company or CDN, so it typically returns a generic name like server-203-0-113-10.example.net rather than the website you started with. Many addresses have no PTR record at all. A reverse lookup is good for identifying the network, not for listing every site on it.

Tip: If you need to block or allow a website in a firewall, use its domain name if the firewall supports it. Rules based on a CDN-hosted site's IP addresses break whenever the provider changes them and can affect every other site sharing those addresses.

Frequently asked questions

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

Usually not through DNS. The CDN deliberately hides the origin server, and DNS only returns the CDN's addresses. Historical DNS records or misconfigured subdomains sometimes reveal an origin, but a well-configured site only accepts traffic from its CDN, so the origin address would not be useful to a normal visitor anyway.

Why does nslookup show a different IP from ping?

They may use different resolution paths. nslookup queries a DNS server directly, while ping uses the system resolver, which checks the hosts file and may prefer IPv6. With load-balanced sites, two queries a few seconds apart can also return different addresses.

Can I visit a website by typing its IP address?

Sometimes. It works when the server hosts only that 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, and HTTPS certificates are issued for names, not for the IP.

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

No. It reveals where the server or CDN edge is, and often only the network that owns the address. A company in one country commonly hosts in another and serves visitors from edges everywhere.

Try it yourself

Put this guide into practice with our free tools.

Keep reading

Copied to clipboard