A website's domain name (like example.com) points to one or more IP addresses through DNS. To find those IPs you run a DNS lookup — from a terminal or in the browser. Below are five ways, then a note on why a single domain often returns several addresses.
→ Skip the terminal: use the free DNS Lookup tool. Enter a domain, get its A (IPv4) and AAAA (IPv6) records.
1. nslookup (Windows, macOS, Linux)
nslookup ships with every desktop OS.
nslookup example.com
The address under Non-authoritative answer is the site's IP. Add a record type to ask for IPv6:
nslookup -type=AAAA example.com
2. dig (macOS, Linux, and Windows via WSL)
dig gives cleaner output and is the standard tool for DNS work.
dig +short example.com
dig +short AAAA example.com
+short prints just the addresses. Without it, read the ANSWER SECTION.
3. host (macOS, Linux)
The quickest one to type:
host example.com
It lists the IPv4 and IPv6 addresses and any mail servers in one go.
4. ping (any OS)
ping resolves the name before it sends its first packet, so the IP shows in the first line:
ping example.com
Use this only as a fallback. Many servers do not answer ping, and you see just one of possibly several IPs. Press Ctrl+C to stop it.
5. A browser DNS lookup
No terminal needed. The DNS Lookup tool resolves A, AAAA, MX, NS, TXT and SOA records for any domain from the server side, so you also see records your local resolver might cache or filter.
Why one domain returns several IPs
- IPv4 and IPv6. Most sites publish both an A record and an AAAA record.
- Load balancing. Large sites list several A records and rotate which one comes first (DNS round-robin).
- CDNs. If the site sits behind Cloudflare, Fastly, Akamai, and similar, the IP you get belongs to the CDN edge nearest you, not the origin server. It changes by location and over time.
What you can do with a website's IP
- Check who owns the block. An IP WHOIS lookup returns the registry owner, network range (CIDR), and abuse contact — useful for reporting abuse or identifying a host.
- See the reverse DNS. A reverse DNS lookup shows the PTR hostname set for that IP, which often names the hosting provider or data centre.
- Estimate the region. IP geolocation gives an approximate country and city for the server — an estimate, not a registered address. See WHOIS vs geolocation for the difference.
- Read the full background. Reverse DNS and PTR records explained.
One caution: the IP behind a domain can change without notice, especially on shared hosting or a CDN. Re-check it rather than hard-coding it anywhere.
Finally, whatever sits behind your own IP — router admin panel, hosting account, FTP — deserves the same scrutiny. Put a strong password on those accounts.