Why you may need it
You may need the IP address of a domain to set up DNS records, to fix connection problems, to allow or block a server in a firewall, or to check where a site is hosted.
Method 1: ping
- Open Command Prompt (Windows) or Terminal (Linux, macOS).
- Run:
ping example.com
- The first line shows the IP address in brackets. Stop it with
Ctrl + Con Linux and macOS.
Method 2: nslookup
nslookup example.com
The answer lists the DNS server you asked, and below it the IP addresses of the domain. nslookup also lets you ask for other records, such as MX or TXT:
nslookup -type=MX example.com
Method 3: dig (Linux and macOS)
dig +short example.com
It prints only the IP address. Add A or AAAA to choose IPv4 or IPv6.
Method 4: An online tool
If you prefer a web page, use a lookup tool such as WhatIsMyIPAddress, IPAddress.com, DNSChecker or Whois.net.
- Open the website of the tool.
- Type the domain in the search box.
- Click Search or Lookup. The result shows the IP address and often more data.
An online tool is quick, but it shows what its own DNS server sees. For a new DNS change, a command on your own machine may show something different.
Method 5: Your DNS provider
Log in to your DNS control panel and open the DNS zone of the domain. The A record shows the IPv4 address and the AAAA record shows the IPv6 address.
Quick recap
ping,nslookupanddigare the fastest tools.- The A record in your DNS zone also shows it.
- A CDN may hide the real server address.