24.3 C
Muhammad Nabeel
Network and System Administrator

How to use nslookup in Linux

nslookup is a network administration command-line tool available in many computer operating systems for querying the Domain Name System (DNS) to obtain domain name or IP address mapping, or other DNS records information. The name “nslookup” means “name server lookup”

There are many options can be used in nslookup command however we will use some of them in this article.

command syntax

nslookup [option]

- Advertisement -
nslookup google.com

nslookup -type=a google.com

nslookup with domain name or -type=a will display the A Record (IP Address) of the domain. here google.com is a domain name. Use these commands to find the IP address or A record for a domain.


If you want to see reverse DNS lookup use IP address with nslookup command

nslookup -type=any google.com

Above command will display all available DNS records of domain google.com

nslookup -type=ns google.com

You can use -type=ns with nslookup command to get Name Servers of the domain.

nslookup -type=mx google.com

MX stands for Mail Exchanger which is email server, run above command to see mail server of a domain.

nslookup -type=txt google.com

TXT records can be used for many purposes like SPF, DKIM, DMARC records etc if you want to see all of them use option -type=txt with nslookup command.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"


Please enter your comment!
Please enter your name here

Latest article