How to Find the IP Address of a Website in Linux

How to find an IP address of a website or domain using terminal?

Finding the public IP address of a website’s server is absolutely easy. In fact, there are several ways you can find the IP address of a website. I am going to show you some of them here.

You might need to install nslookup. If you have the rights, you can use your Linux distribution’s installation command to install this tool. On Debian and Ubuntu, the command below will install nslookup:

sudo apt install nslookup

Once you have the tool, just use it in the following fashion:

nslookup <website>

Same goes for ping command:

ping <website>

You’ll have to use Ctrl+C to stop the ping command. A sample output of nslookup command looks like this:

user@host:~$ nslookup google.com
Server: 192.168.1.2
Address: 192.168.1.2#53

Non-authoritative answer:
Name: google.com
Address: 216.58.212.46
Name: google.com
Address: 2a00:1450:4017:800::200e

You can use the same way the dig command, which have some great functionality for dealing with DNS and NS.