DNS Info Zone Commands Nslookup command – five easy examples

Nslookup command – five easy examples

Nslookup command explained

The Nslookup command is a commonly used tool with a command-line interface. Usually, it is applied for DNS probing. Nslookup command is perfect if you want to check a domain name, its IP address, and various DNS records. The great benefit is that it is typically pre-built on almost every OS. Additionally, the Nslookup command presents clean and straightforward answers. 

Nslookup command – How to start it?

For macOS

1. Press the command button and the Spacebar button.

2. Search the name of the app – Terminal.

3. Now, you are able to write Nslookup commands.

For Windows

1. Press the Windows key and the letter “R” to start the run application.

2. Type “cmd” and press “Ok.”

3. Now, you are able to use the Nslookup command. 

Let’s see the examples below.

Examples

Without additional options

nslookup domain.com

That is the basic Nslookup command, and it will provide an answer with the IPv4 and the IPv6 addresses of the domain you want. You will receive a short answer with only the required IP address. Additional information about the A or AAAA records like TTL values is not included.

Nslooup for any type of DNS

nslookup -type=any domain.com

With this version of the Nslookup command, you will quickly receive all of the available DNS records for a particular domain name. That could include A, AAAA, MX, NS, SOA, and TXT, such as the SPF record. The query could take a little more time, but when it is answered, you will be able to view the content of all the DNS records for this hostname. Thus, it is perfect for when you want to acknowledge the bigger picture and make a more specific query afterward. To accomplish that, you just have to change the part “any” with the particular DNS record type you want to see.

Nslookup with IP address

Nslookup 132.117.14.138

You can perform a Reverse DNS lookup with the IP address. It doesn’t matter if it is an IPv4 or IPv6 address. It is easy to view the host corresponding to that IP address. 

Nslookup and timeout in seconds

nslookup -timeout=30 domain.com

Whit this Nslookup command, you can define a 30-second interval for waiting for a response. Make sure to give more time for receiving an answer from a nameserver located further away. You can adjust the number as you prefer.

Nslookup command and port number

nslookup -port=43 domain.com

You can define which port number to use for a particular query. Additionally, you can check if a chosen port operates accurately or see if you have correctly blocked another. Feel free to replace the number and test yourself. 

*Just change the domain name with the one you want to check or perform Reverse DNS with the IP address you desire. As we mentioned, it could be an IPv4 or IPv6 address. Try the commands by simply copy and paste with the domain name you want.

Conclusion

The Nslookup command is a very simple and, at the same time, very effective tool for domain probing. The best part is that it is already installed on your device. So, go on and try it out!  

1 thought on “Nslookup command – five easy examples”

Leave a Reply

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

Related Post

Traceroute command

Traceroute command explainedTraceroute command explained

If you want to know everything about the traceroute command, you came to the right place. Here you will learn what is it, why to use it and how.

Traceroute command explained

Traceroute command, just like the rest of the popular network commands, is a simple small software with command-line interface (CLI) and comes built-in on most Linux distros, BSD distros and even macOS.

It is easy to understand its purpose, to trace the route of a query, from your computer, through all the routers (hops) on the way, to the target that you set.

The result will be data on each hop (host name and IP address), showing if the packets of data arrive and after what amount of time, and which was the next hop.

Traceroute options for Windows, Linux, and macOS

(more…)