What you need to know
A website's IP address is the numerical identifier that points your browser to the server where the site's files live. You can find it using free command-line tools on Windows, Mac, or Linux, or through online lookup services that do the work in your browser. The method you choose depends on whether you want a quick answer or need more detail about the domain's setup.
Most people never need to know a website's IP address — your browser finds it automatically. But if you're troubleshooting connection problems, checking whether two sites share the same server, or researching a domain's history, knowing how to look it up is useful.
Key Takeaways
- The command-line tool nslookup (Windows, Mac, Linux) or dig (Mac, Linux) shows a website's IP address in seconds without installing anything.
- Online lookup tools like MXToolbox, WHOIS lookup sites, and DNS checkers work in your browser and show the IP address plus related information like mail servers and nameservers.
- A website may have multiple IP addresses if it uses a content delivery network (CDN) or load balancer, so the address you find might not be the only one.
- The IP address you find is usually the server's public address, not the physical location of the hardware.
Using nslookup on Windows, Mac, or Linux
nslookup is built into Windows, Mac, and Linux and requires no installation. Open your command prompt (Windows), Terminal (Mac), or terminal window (Linux) and type: nslookup example.com — replace example.com with the website you're checking. Press Enter.
The tool returns the IP address in the line labeled "Address:" — usually the first result. You'll also see the nameserver that answered the query. This method is fast and works offline once your system has cached the domain information, though it queries a nameserver if the data isn't cached.
If nslookup returns "Non-existent domain" or "NXDOMAIN," the domain either doesn't exist, is misspelled, or has no DNS records pointing to an IP address. If you see multiple addresses, the site uses load balancing or a CDN to spread traffic across servers.
Using dig on Mac or Linux
dig (Domain Information Groper) is available on Mac and Linux and shows more detail than nslookup. Open Terminal and type: dig example.com. The IP address appears in the "ANSWER SECTION" next to the "A" record.
dig also displays the query time, the authoritative nameserver, and whether the answer came from cache. If you want only the IP address without extra information, type: dig example.com +short. This returns just the address in one line.
dig is preferred by system administrators because it shows the full DNS response, including TTL (time to live) values that control how long the address is cached. For most users, nslookup is simpler, but dig is worth learning if you troubleshoot DNS problems regularly.
Using online lookup tools
If you don't want to open a terminal, websites like MXToolbox, WHOIS.net, and DNS Checker let you type a domain name and see the IP address in your browser. These tools also show related information: mail server addresses, nameservers, and WHOIS registration details.
Go to any of these sites, enter the domain name in the search box, and click the lookup button. The IP address appears within seconds. Most of these services are free and don't require an account. Some offer paid plans with more detailed reports or bulk lookups, but the basic IP address lookup is always free.
Online tools are useful when you're on a computer where you can't or don't want to use the command line, or when you need to see DNS records beyond just the IP address. The downside is that you're sending the domain name to a third-party server, though this is not a security risk for public websites.
Understanding what the IP address tells you
The IP address you find is the server's public address on the internet. It doesn't tell you the physical location of the hardware — a server in California might have an IP address registered to a different state. If you need the actual location, you can use a geolocation tool, but understand that the result is an estimate based on the IP address's registration, not the server's true position.
If a lookup returns multiple IP addresses, the site uses either a CDN (which caches content on servers worldwide) or load balancing (which spreads requests across multiple servers). Both are normal for large websites. Checking the IP address again later might return a different address, especially for sites using CDNs.
Some websites hide their IP address behind a proxy service like Cloudflare. In this case, the IP address you find belongs to Cloudflare's servers, not the website's origin server. This is a security feature that protects the origin server's real address from being exposed.
Checking if two websites share the same server
To see whether two websites run on the same server, look up the IP address for each one. If both return the same IP address, they're hosted on the same machine — though they may still be separate accounts with different owners. If the addresses differ, they're on different servers.
Keep in mind that shared hosting is common: many small websites run on the same server under different domain names. Finding that two sites share an IP address doesn't mean they're related or owned by the same person — it usually just means they use the same hosting provider.
Troubleshooting DNS lookup problems
If nslookup or dig returns an error, the problem is usually one of three things: the domain name is misspelled, the domain has no active DNS records, or your internet connection can't reach a nameserver. Try typing the domain name again, checking for typos. If the error persists, try looking up a domain you know works (like google.com) to confirm your connection is working.
If a domain you know exists returns "NXDOMAIN," the domain's DNS records may have been deleted or the nameservers may not be configured correctly. This sometimes happens during domain transfers or after a registrar change. Contact the domain's owner or registrar to check the DNS setup.
If you get a timeout error, your system may not be able to reach a nameserver. This is rare on a working internet connection but can happen behind certain corporate firewalls. Try using a public DNS server like Google's (8.8.8.8) or Cloudflare's (1.1.1.1) by changing your system's DNS settings, then try the lookup again.
Frequently Asked Questions
Can I find a website's IP address if it's behind Cloudflare?
Yes, you can find the Cloudflare IP address, but not the origin server's real IP address — that's the point of Cloudflare's proxy. The address you find belongs to Cloudflare's network. If you need the origin server's address for legitimate reasons, you'd need to contact the website owner directly.
Is it legal to look up a website's IP address?
Yes. IP addresses are public information — your browser looks them up every time you visit a website. Looking up an IP address is no different from checking a phone number in a directory. There's nothing illegal or unethical about it.
Why does a website have multiple IP addresses?
Multiple addresses usually mean the site uses a content delivery network (CDN) or load balancing. CDNs cache content on servers around the world, so your lookup might return a server near you. Load balancers spread traffic across multiple servers to handle high traffic. Both are normal for busy websites.
Can I find a website's location from its IP address?
You can estimate the location using geolocation tools, but the result is often inaccurate. The IP address is registered to a location, but the actual server hardware may be elsewhere. For public websites, the registered location is usually a data center, not the website owner's office.
What's the difference between an A record and an AAAA record?
An A record points a domain to an IPv4 address (the standard format like 192.0.2.1), while an AAAA record points to an IPv6 address (a newer format like 2001:db8::1). Most websites use both. When you look up a domain, you're usually seeing the A record, but modern sites support both types.