How to Look Up a Website's IP Address

Updated on

The browser will automatically look up IP addresses for you, but the purpose of this tutorial is to understand how things work, so let’s “dig” into it manually.

The dig Command

You can use the dig command to look up the IP address of a domain.

Type the following command in a terminal window:

dig example.com +short

(If it says that the command isn’t found, see the how to install and use the dig command tutorial.)

It will then print out the IP address for example.com.

The output of the dig command

The ping Command

Another quick way to look up a domain’s IP address is to use the ping command. After typing the command below, stop the output by pressing ctrl-c.

ping example.com

dig has more features than ping though.

Browser Network Tools

One additional way you can view IP addresses of remote websites is to open the network tab of the developer tools in Firefox.

Right click on the header row and make sure that “Remote IP” is checked. The remote IP addresses will then appear in the table.

Looking up IP addresses in Firefox browser developer tools

In the next section we’ll look at how the browser finds the IP address using DNS (the Domain Name System).

Domain name being converted to IP address

Takeaways

Things you should know from this section:

Return to the main tutorial page.

Feedback and Comments

What did you think about this page? Do you have any questions, or is there anything that could be improved? You can leave a comment after clicking on an icon below.