How to do a DNS lookup in terminal?

What is use of nslookup command in Linux?

Nslookup is a command which is used to check the IP address and port of a host.

You can use nslookup command for checking whether your modem is connected properly to a router or not.

It's an alternative to ping. Nslookup can connect to a specific hostname (or CNAME), but you need to provide both the hostname and the domain.

For example, nslookup will query a recursive nameserver to find all google records that have the name www. The same syntax works for resolving hostnames, or for querying specific servers, such as ntp.ubuntu.

It will check the domain and return the IPs of hosts that resolve to that domain. So, nslookup and nslookup will both return the same set of IPs, the first one being and the second one being google.

Related Answers

What is the difference between DNS lookup and reverse DNS lookup?

A "reverse lookup" is a function performe...

How to create DNS reverse lookup zone in Windows Server 2012 r2?

The reason to create reverse lookup zone is for a DNS server, when yo...

What is the domain name server?

Domain name server is a small program (server) on a personal c...