How to Find the IP Address of Any Website Using the Linux Terminal

Why Find a Website’s IP Address?

When you type a URL like google.com into your web browser, your computer uses the Domain Name System (DNS) to translate that human-readable domain name into a numerical IP address (like 142.250.190.46). The IP address is the actual coordinate that tells your computer where the web server is located on the internet.

There are several reasons you might need to find the specific IP address of a website:

  • Troubleshooting Network Issues: If a website is not loading, you can ping its IP address directly. If the IP address loads but the domain name does not, you know you have a DNS resolution problem, not an internet outage.
  • Configuring Firewalls: If you are setting up a firewall or a network blocklist, you often need to input the exact IP addresses of the servers you want to block or allow.
  • Bypassing DNS Blocks: Some local networks block access to websites by filtering their domain names. Accessing the site via its direct IP address can occasionally bypass these simple filters.

If you are using a Linux distribution, you do not need to use third-party websites to look up this information. You can find it instantly using built-in terminal commands.

Method 1: Using the ‘ping’ Command

The ping command is the most universal and straightforward tool for this job. It is installed by default on virtually every Linux distribution in existence. Its primary purpose is to test the connection speed between your computer and a server, but it must resolve the IP address to do so.

  1. Open your terminal application (shortcut: Ctrl + Alt + T in Ubuntu).
  2. Type ping followed by a space and the domain name of the website. (Do not include the https:// or www. prefix).
    ping digitash.com
  3. Press Enter.

The terminal will immediately begin outputting data. Look at the very first line of the output:

PING digitash.com (104.21.25.10) 56(84) bytes of data.

The numbers inside the parentheses (e.g., 104.21.25.10) represent the IPv4 address of the website.

To stop the ping command from running continuously, press Ctrl + C.

Method 2: Using the ‘host’ Command

While ping works, the host command is specifically designed for DNS lookups and provides a much cleaner, more informative output. It will often reveal multiple IP addresses if a large website uses several servers for load balancing.

  1. Open your terminal.
  2. Type the following command:
    host digitash.com
  3. Press Enter.

The output will clearly list the IP addresses associated with the domain:

digitash.com has address 104.21.25.10
digitash.com has IPv6 address 2606:4700:3036::6815:190a

This method is superior because it shows both the older IPv4 addresses and the newer IPv6 addresses without continuously sending data packets to the server.

Method 3: Using the ‘nslookup’ Command

For network administrators, nslookup (Name Server Lookup) is the standard tool. It not only provides the IP address of the website but also tells you which DNS server on your network provided the information.

  1. Open your terminal.
  2. Type the following command:
    nslookup digitash.com
  3. Press Enter.

The output is split into two sections. The first section details the "Server" that processed your request (usually your local router or ISP’s DNS server). The second section, labeled "Non-authoritative answer," provides the Address (the IP address) of the website you queried.

By using any of these three commands, you can instantly translate any domain name into its underlying IP address directly from the Linux command line.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.