How to Find the IP Address of a Domain
To find the IP address of a domain, run dig +short example.com on macOS or Linux, or nslookup example.com on Windows. The address returned is the domain's A record. If it belongs to a CDN such as Cloudflare, you are seeing the proxy, not the server that stores the site.
For site owners checking where a domain points after a DNS change, a migration or a hosting move.
knowledge
- Read time
- 4 min
- Sections
- 6
- Updated
- 14 Nov 2026
- Written by
- WebJi® team
Last editorial update: 14 November 2026.
Which command finds the IP address of a domain?
Use dig +short example.com on macOS or Linux and nslookup example.com or Resolve-DnsName on Windows; each asks DNS for the domain's A record and prints the IPv4 address. Replace example.com with your domain, and run the same command for the www name, which can point somewhere else.
| System | Command | What it returns |
|---|---|---|
| macOS, Linux | dig +short example.com | IPv4 address only |
| macOS, Linux | dig +short example.com AAAA | IPv6 address, if published |
| Linux | host example.com | IPv4, IPv6 and mail servers in one go |
| Windows CMD | nslookup example.com | Resolver used, then the Address lines |
| Windows PowerShell | Resolve-DnsName example.com -Type A | Name, TTL and IP address as a table |
| Any system | ping example.com | The resolved IP in the first line, even if replies are blocked |
No terminal handy? The WebJi® DNS lookup tool shows the A, AAAA, MX and NS records in a browser.
How to read dig and nslookup output
The only value you need is the address at the end of the A-record line; the rest tells you the name queried, how long it may be cached and which resolver answered. A full dig example.com A answer section looks like this:
;; ANSWER SECTION:
example.com. 300 IN A 203.0.113.25
;; SERVER: 1.1.1.1#53(1.1.1.1)
- example.com.
- The name looked up; the trailing dot marks the DNS root.
- 300
- TTL in seconds: how long a resolver may reuse the answer before asking again.
- IN A
- Internet class, A (IPv4) record. AAAA would mean IPv6; CNAME means the name points to another name, which dig then follows.
- 203.0.113.25
- The IP address. This one is a documentation placeholder; your domain returns its own.
- SERVER
- The resolver that answered, here Cloudflare's public 1.1.1.1.
On Windows, nslookup first prints the resolver's own name and address, then “Non-authoritative answer” followed by the domain's Address lines. Non-authoritative is normal: it means a cache answered rather than the domain's own nameserver. The record types themselves are covered in DNS records explained.
Why do two lookups return different IP addresses?
Different answers usually mean a recent DNS change still cached by some resolvers, a local hosts-file entry, or a domain spread across several servers or a CDN. Ask more than one source before deciding which address is right.
- Query a public resolver directly:
dig @1.1.1.1 +short example.comanddig @8.8.8.8 +short example.com. - Find the domain's nameservers with
dig +short NS example.com, then ask one of them:dig @ns1.yourdns.com +short example.com. That authoritative answer is the current truth. - If your browser still opens the old server, check the hosts file; the hosts file guide shows where it lives on each system.
- Watch the change spread worldwide with the DNS propagation checker; old answers expire within the previous TTL.
Large sites also return several A records at once, or a different address per region; every one of them is valid.
Why does the IP belong to Cloudflare or another CDN?
When a domain is proxied through a CDN, its public A record holds the CDN's address, and the CDN forwards each request to the real server behind it. That is by design: the origin server's address stays private, which also protects it from direct attacks.
So a lookup cannot reveal the origin of a proxied site, and you should not try to bypass the proxy on a site you do not own. For your own site, the origin address is in your hosting panel or your CDN dashboard's DNS settings. One practical consequence: a firewall rule that allows “your domain's IP” will allow the CDN, not your visitors.
How to do a reverse lookup from IP to hostname
Run dig -x 203.0.113.25 +short on macOS or Linux, or nslookup 203.0.113.25 on Windows, to read the PTR record that maps an address back to a name. The owner of the IP block, not the domain owner, controls that record.
On shared hosting the reverse name is therefore usually the provider's server hostname, not your domain. That is normal for websites. It matters for email: a mail server sending from its own IP needs a PTR record that matches its hostname, or receiving servers may mark its mail as spam.
Where to find the IP address your host assigned
In cPanel, the account's address is under General Information → Server Information → Shared IP Address; this is the value to put in the domain's A record when the DNS is managed elsewhere. Many domains share one address on shared hosting, which is why a reverse lookup shows the server name.
If the public lookup and the panel disagree, the domain points somewhere else. Update the A record where the zone is hosted (check with how to find your nameservers), then allow up to the old TTL for the change. Email keeps working during the move, because mail follows the MX record, not the A record. A fixed address of your own comes with a VPS; the trade-offs are in dedicated IP vs shared IP. Stuck? Email support@webji.services with the domain and your dig output, 24/7 in Hindi and English.
Frequently asked questions
Can I find a website's IP address on an Android phone or iPhone?
Phones have no built-in dig or nslookup, so use a browser-based DNS lookup tool or a network utility app. Enter the domain and read the A record. Results come from the tool's resolver, which may differ briefly from your mobile network's cache after a change.
Why does nslookup say “can't find” or NXDOMAIN?
NXDOMAIN means the name does not exist in DNS: a typo, an expired or unregistered domain, or a subdomain with no record. If the domain is registered, check that its nameservers are set and that the zone has an A record for that exact name.
How do I find the IPv6 address of a domain?
Query the AAAA record: dig +short example.com AAAA or nslookup -type=AAAA example.com. An empty answer means the domain publishes no IPv6 address and is reachable over IPv4 only.
Does the IP address show where a website is hosted?
Only roughly. A WHOIS lookup on the IP shows which network or provider owns the address block. With a CDN in front, it shows the CDN, not the host, and IP geolocation databases can place an address in the wrong city.
Last editorial update: 14 November 2026.
Ready to get started with WebJi®?
Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.