How to determine the IP address of a computer or website

Updated: 07/13/2023 by Computer Hope

This page discusses the best ways to find the IP address of an external computer or website. To find the IP address of the computer you're currently working from, see: How to find my IP address.

IP address

If you know the domain name, URL (Uniform Resource Locator), network name of a website or networked computer, and you want to find its IP address, perform a DNS (Domain Name System) lookup. There are a few ways to do this, which we cover below.


The ping command sends an ICMP (Internet Control Message Protocol) packet to a networked computer. If you try to ping a hostname, the ping program performs 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 similar to the following:

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, 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, which means 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," performs 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 (Internet Systems Consortium) BIND (Berkeley Internet Name Domain) 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 (User Account Control) 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, add the BIND binary directory to your PATH environment variable, so 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\, 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 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