5 popular examples of the Nslookup command

So, you have heard that there is a network command that works on any OS, and you would like to try it out, right? Then, you came to the right place! Here we have 5 popular examples of the Nslookup command that will show you its capability. After seeing them, you can decide if you should integrate them into your network toolset.

How to install the Nslookup command?

1. Check all DNS records of a domain name.

Do you know that there is a way to see a list of all of the available DNS records (A, AAAA, MX, CNAME, SOA, NS, etc.) with a single command? Yes, that way, you can quickly see all the information about a domain. This Nslookup example will teach you.

nslookup -type=any google.com

-type= – this is the option for setting up DNS record type.

Any – means any type of DNS record available.

Googe.com – is the target. You can choose any domain name or IP address.

The answer will be long, but it will give you a good view of the DNS zone.

2. Check specific DNS record type.

The last command that shows all of the available records is good, but you can find only the specific type of records with a more precious search. Using this example, you can make a quick DNS lookup for the DNS type you need.

nslookup -type=A google.com

A – stands for A records.

The syntax here is the same as in the previous example. The only difference is the type of record. You can change the A, with the record type you need. Examples – NS, SOA, CNAME, AAAA, MX, TXT, etc.

3. Use another resolver to perform the query.

You can use another resolver, not only the one of your current device. That way, you can check what results you can get if the query originates in another location in the world.

nslookup google.com 1.1.1.1

1.1.1.1 – is the DNS resolver that we use to probe the target google.com. You can use another DNS resolver for testing. The 1.1.1.1 one belongs to Cloudflare. You can try Google’s Public Resolver, which is 8.8.8.8, or Quad9 9.9.9.9.

4. Reverse DNS lookup with Nslookup command.

Testing your Reverse DNS zone is possible with the Nslookup command. You can check a particular IP address and see if there is a PTR record for it. After testing the IP address, you should see the domain name that corresponds to it.

nslookup 216.58.214.142

216.58.214.142 – is an IP address of Google. You can use another one. 

Reverse DNS is used for email verification. If you want to have your own email server, you should definitely start using it, or your emails can get lost in the recipients’ SPAM folder.

5. Probe through a specific port.

Yes, you can see if a port is open on a particular name server by performing a DNS lookup with the Nslookup command and the option for a particular port.

nslookup -port 53 google.com

-port – the option that defines the port in use for the lookup.

53 – the port we are using in this example. You can change it with any other number.

Google.com – again we use Google.com for the target. 

Suggested article: Testing Reverse DNS with Dig command

Conclusion.

These were 5 examples of the Nslookup commands. Now go ahead and try them with your domain. See how easy it is and how useful is that the Nslookup is available on Windows, macOS, Linux, and BSD. Yes, the Dig command has more options, but it is still very useful to know another more universal command.

Leave a Reply

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