How to find the IP address of any website (and what the number actually tells you)

Run nslookup or ping with the domain, or paste it into an online DNS lookup, and you get the address the name points to. On many sites that address belongs to a network sitting in front of the server, and it tells you very little about who runs the site.

By Jack Stovell Published

Short answer: finding the number takes a few seconds. Reading it correctly takes a bit longer, because the address you get is often a front door. It may sit in front of the real server, change from one lookup to the next, or be shared with plenty of other sites.

The quick answer: three ways to look up a site’s IP address

You have three options: nslookup on your own computer, ping on your own computer, or an online DNS lookup in your browser. Each one asks the Domain Name System (DNS) which address a name points to.

Two record types matter here. An A record holds an IPv4 address, and an AAAA record holds an IPv6 address. A site can have either or both, which explains a lot of the confusion later on.

Method 1: nslookup or ping on your own computer

On Windows, both commands are in Command Prompt.

nslookup. Type nslookup, a space, then the domain, and press Enter. You get the name of the DNS server that answered, then the site’s name and one or more addresses. To ask only for IPv6 addresses, add the option -type=AAAA before the domain. If you add the name or address of a different DNS server after the domain, nslookup asks that server instead of your default one, which is a quick way to get a second opinion.

ping. Type ping, a space, then the domain. The first line shows the domain followed by an address in square brackets. That bracketed address is the one your computer resolved the name to. The lines that follow show replies from the host or “Request timed out”. Ping exists to test whether a host can be reached, so the replies show whether the host answered. The bracketed address on the first line is the bit you need. To force an IPv4 or IPv6 answer, add /4 or /6.

Both commands show the answer your own device was given, which is not necessarily what everyone else gets. That point matters below.

Mac and Linux machines have their own command-line tools for this. Check your system’s documentation for the exact commands and options before relying on them.

Method 2: an online DNS lookup, and when to prefer it

An online DNS lookup does the same job in a browser: you type the domain and read the records it returns. It is the easier route on a locked-down work computer, or if you would rather not use a command line. Many of these tools also show the A and AAAA records side by side.

The tool runs the query from its own servers, so its answer can differ from yours. That makes it a useful cross-check rather than a worse result. Any reputable lookup will do. If what you really want to know is whether a link is safe to open, a link checker answers that question directly. An IP lookup does not.

Why the number you get may not be the website’s server

Many sites sit behind a reverse proxy, often as part of a content delivery network (CDN). The proxy sits in front of the site’s origin server, which is where the site is actually stored. Visitors connect to the proxy at the network edge, and the proxy talks to the origin server for them.

The result is that DNS gives you the proxy’s address. A site behind a reverse proxy never has to reveal its origin server’s address, and protection from attacks is one of the main reasons sites set things up this way. So the number you found shows where the site’s public entrance is. The server behind it could be somewhere else entirely, and the lookup cannot show you where.

Why two lookups can give different answers

If nslookup and an online tool give different addresses, nothing has gone wrong. There are three common reasons.

Treat a mismatch as normal behaviour, not as a warning sign.

Several sites on one IP: what reverse lookups can and cannot show

One address can serve many websites. With virtual hosting, one server holds several sites, and every browser request includes a Host header naming the site it wants. The server reads that header to decide which site to send back.

So an IP address is not a unique label for one website. A reverse lookup, which goes from an address back to a name (nslookup does this if you give it an address instead of a domain), returns the name recorded for that address. That name does not have to be any of the sites on it. It cannot list every site on the address, and it cannot tell you whether those sites are connected. Two sites on the same address may just rent space from the same company.

What an IP address does not tell you about a site

Location. IP geolocation is an estimate. MaxMind, a geolocation provider, says it cannot guarantee accuracy. It also says that for an address belonging to a website host it may only be able to locate the server, and that its data is never precise enough to identify a household or street address. A result that puts a site in a country tells you roughly where that address’s network is, not where the business is based.

Ownership. A WHOIS or RDAP lookup on an IP address returns the network record, the organisation the address range is registered to, and that organisation’s contacts. For a site behind a CDN or on shared hosting, that is the network or hosting company. It is not the person or company running the website.

Trustworthiness. The number says nothing about whether a site is honest. For that question, read how to tell if a website is legitimate. To find out who is behind a site, finding the publisher will get you much further than an IP lookup. Our how we check page explains how this site verifies tools.

When you do not need the IP at all

For most everyday questions you do not need it. To check a link, use a link checker. To judge a shop or a news source, look at who publishes it and what they say about themselves.

A different question often gets mixed up with this one: finding the IP address of someone who visits your own site. That has nothing to do with DNS. The address appears in your server logs or analytics. Handle it with care, because the ICO lists IP addresses among the online identifiers that can make information personal data under UK GDPR.

A worked example: reading one lookup result

Say you run nslookup on a well-known domain and get back one IPv4 address and one IPv6 address. Here is what that tells you.

The lookup is useful for troubleshooting and for satisfying curiosity. To decide whether to trust a site, look at the site itself and the people behind it.

Sources

Questions people ask

How do I find the IP address of a website?

On Windows, open Command Prompt and type nslookup followed by the domain, or ping followed by the domain. Ping shows the resolved address in brackets on its first line. You can also paste the domain into an online DNS lookup. All three ask DNS which address the name points to.

Why does ping show a different IP address from the one my host gave me?

Ping shows whatever DNS returned to your device. If your site sits behind a reverse proxy or content delivery network, the public address is the proxy's, so your host's server address is never shown. Load balancing can also give different users different addresses for the same name.

Can I tell who owns a website from its IP address?

Not usually. A WHOIS or RDAP lookup on an IP address shows the organisation the address range is registered to, which is normally a network or hosting company. Geolocation is approximate and may only locate the server. To find out who runs a site, look for its publisher.

Can two websites share the same IP address?

Yes. With virtual hosting, one server at one address can serve many sites, and it uses the Host header in each request to decide which site to return. Two sites sharing an address may have nothing else in common.

Is finding a website's IP address legal?

Looking up a domain makes the same kind of DNS query your browser sends every time it loads a site, and the answer is published so that browsers can connect. For a legal view on anything beyond that, ask someone qualified. Visitor IP addresses on your own site are a different matter, because under UK GDPR they can count as personal data.