How to Install and Use nslookup Linux Command

Learn to install & utilize 'nslookup' command on Linux for efficient DNS queries & network troubleshooting in comprehensive steps.

7. Jan 2024
How to Install and Use nslookup Linux Command

The 'nslookup' command is a useful tool for network diagnostics and troubleshooting since it provides a quick and easy way to query DNS (Domain Name System) servers and retrieve domain-related data. Its importance stems from its capacity to quickly get vital information, enabling users to explore the complexities of network settings and efficiently address problems. Gaining proficiency in utilizing 'nslookup' is essential for anybody managing a network or resolving issues. Here’s a detailed guide on installing and effectively using 'nslookup' on your Linux system.

Step 1: Checking 'nslookup' Availability

Start by verifying if 'nslookup' is already installed. Open the terminal and enter:

nslookup -version

If 'nslookup' is installed, it will display its version information. If not, proceed with the installation.

Step 2: Installing 'nslookup'

1. Using Package Manager: Install 'nslookup' through the package manager suitable for your Linux distribution:


sudo apt-get update
sudo apt-get install dnsutils

Red Hat/CentOS:

sudo yum install bind-utils

Arch Linux:

sudo pacman -S bind-tools

2. From Source (Optional): Compile and install 'nslookup' from the BIND (Berkeley Internet Name Domain) source if not available through the package manager.

Step 3: Using ‘nslookup’

1. Basic Queries: Enter the following command to perform a simple DNS query:

nslookup domain_name

Replace 'domain_name' with the website or domain you want to query. This command retrieves the corresponding IP address.

2. Reverse DNS Lookup: Conduct a reverse lookup by entering the IP address:

nslookup IP_address

Substitute 'IP_address' with the specific IP you want to resolve to a domain name.

3. Querying Specific DNS Server: Specify a particular DNS server to perform the lookup:

nslookup domain_name dns_server

Replace 'dns_server' with the IP address of the DNS server you want to use.

Step 4: Advanced Options

1. Changing Query Type: Use the '-type' flag to specify the query type:

nslookup -type=record_type domain_name

Replace 'record_type' with types like 'MX' for mail servers or 'SOA' for Start of Authority records.

2. Setting Timeout: Adjust the query timeout with the '-timeout' flag:

nslookup -timeout=5 domain_name

This sets the query timeout to 5 seconds.

Step 5: Verifying Results

Check the retrieved information, ensuring it matches the expected DNS records. Verify the IP addresses and associated domain names for accuracy.


The 'nslookup' command serves as an invaluable asset for network administrators and enthusiasts, offering a robust platform for conducting DNS-related queries and troubleshooting tasks. This in-depth tutorial aims to provide you with the knowledge necessary to successfully install 'nslookup' on your Linux system. Through investigating its features, you will acquire the ability to utilize its potential for smooth DNS queries, improving your skills in network troubleshooting and diagnosis. Accept the power of 'nslookup' to quickly and effectively explore domain-related data, facilitating a better comprehension and expert administration of your network architecture.

Join our WhatsApp Channel to Get Latest Updates.


Note - We can not guarantee that the information on this page is 100% correct.


Downloading any Book PDF is a legal offense. And our website does not endorse these sites in any way. Because it involves the hard work of many people, therefore if you want to read book then you should buy book from Amazon or you can buy from your nearest store.


No comments has been added on this post

Add new comment

You must be logged in to add new comment. Log in
Learn anything
PHP, HTML, CSS, Data Science, Python, AI
Gaming Blog
Game Reviews, Information and More.
Learn Anything
Factory Reset
How to Hard or Factory Reset?
Books and Novels
Latest Books and Novels
Osclass Solution
Find Best answer here for your Osclass website.
Check full Information about Electronic Items. Latest Mobile launch Date. Latest Laptop Processor, Laptop Driver, Fridge, Top Brand Television.
Pets Blog
Check Details About All Pets like Dog, Cat, Fish, Rabbits and More. Pet Care Solution, Pet life Spam Information
Lately commented