How to determine the IP address of a computer or website

Updated: 07/25/2017 by Computer Hope

Note: In this article, we'll discuss the best ways to find the IP address of an external computer or website. If instead you want to find the IP address of the computer you're using, please see this article.

IP addressIf you know the domain name or network name of a website or networked computer, and you want to find its IP address, you'll need to perform a DNS lookup. There are a few ways to do this, which we'll cover below.


The ping command sends an ICMP packet to a networked computer. If you try to ping a hostname, the ping program will perform a DNS request to discover the host's IP address. The IP address is displayed in the command output.

On all modern operating systems, you can open a command line interface and run the command:

ping hostname

Where hostname is the name of the computer. For instance, let's say you want to find the IP address of If you are using Microsoft Windows, open the command prompt and run:


You will see something like this:

Pinging [] with 32 bytes of data:
Reply from bytes=32 time=19ms TTL=57
Reply from bytes=32 time=19ms TTL=57
Reply from bytes=32 time=19ms TTL=57
Reply from bytes=32 time=19ms TTL=57

Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 19ms, Maximum = 19ms, Average = 19ms

The pings were sent to, which is an IP address of

However, this information is not complete — it shows one IP address for the host, but there may be others. Also, ping doesn't always succeed. Many websites and computers will completely ignore a ping request.

To perform a direct DNS query, and receive more complete information, use one of the other three methods.


The nslookup command gets DNS information about a host, including its IP addresses. For example, from the Windows command prompt, run:



Address:  your.gateway.address

Non-authoritative answer:
Addresses:  2400:cb00:2048:1::6814:3876

Nslookup performs the DNS lookup, but unlike ping, it does not send any data to the host. There are two IPv4 addresses, and, listed at the bottom. Both are valid IP addresses for that hostname, used in round-robin distribution.

The response is non-authoritative means that you're getting the information from a domain name server not owned by the host.

The nslookup command works on most operating systems, including Microsoft Windows. However, it is an older program, and is no longer actively developed. It is deprecated by the organization that developed it, the Internet Systems Consortium. Instead, they recommend using the newer tools dig and host, discussed below.


Dig, the "domain information groper", will perform a DNS lookup if you give it a hostname:

; <<>> DiG 9.11.0 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29332
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 4096
;              IN      A

;; ANSWER SECTION:       299     IN      A       299     IN      A

;; Query time: 46 msec
;; WHEN: Sun Jul 23 22:28:17 Eastern Daylight Time 2017
;; MSG SIZE  rcvd: 77

Dig comes pre-installed on macOS X and Linux operating systems. On Microsoft Windows, you can download it for free, as part of the ISC's BIND utilities.

Installing BIND on Microsoft Windows

  • In a web browser, go to
  • Scroll to the "BIND" drop-down menu, and expand it.
  • Look for the "Current-Stable" version. Click the Download button for that version.
  • In the dialog that appears, click the button corresponding to your type of computer. For instance, for 64-bit computers running Windows, click the button for win 64-bit.
  • Extract the zip archive.
  • In the extracted folder, right-click BINDInstall.exe, and choose Run as administrator. At the UAC prompt, choose Yes.
  • In the installer options, make sure Tools Only is checked.
  • Choose a Target Directory for the installation, and click Install. If you receive a message about "Visual C++ Redistributable - Modify Setup", click Close, then Yes.

The BIND utilities are now installed, including dig.

As a last step, you will want to add the BIND binary directory to your PATH environment variable, so that you can run dig from any directory. Modify your system's PATH environment variable to include the path to the BIND binaries. If you installed to C:\Program Files\ISC BIND 9\, you should add C:\Program Files\ISC BIND 9\bin\ to your PATH. Don't forget the bin at the end of the path name.


The host command is part of ISC BIND. It's similar to dig, but it displays simpler information.

Host comes pre-installed on macOS X and Linux. On Windows, you can install it as part of the BIND utilities, as described above.


host has address has address has IPv6 address 2400:cb00:2048:1::6814:3276 has IPv6 address 2400:cb00:2048:1::6814:3876 mail is handled by 10