Nslookup Command - DNS Lookup Tool | Online Free DevTools by Hexmos

Perform DNS lookups with the nslookup command. Query domain names, IP addresses, and specific DNS records like MX and NS. Use the nslookup tool for network diagnostics.

Nslookup Command

What is Nslookup?

The nslookup command is a powerful network administration command-line tool used for querying the Domain Name System (DNS) to obtain domain name or IP address mapping, or for any other DNS record. It's an essential utility for diagnosing DNS resolution issues and understanding how domain names are translated into IP addresses.

Common Nslookup Usage Examples

Here are some of the most common ways to use the nslookup command:

Basic DNS Lookup

Perform a basic DNS lookup for a domain to find its IP address.

# Perform a basic DNS lookup for a domain
nslookup example.com

Reverse DNS Lookup

Perform a reverse DNS lookup using an IP address to find the associated domain name.

# Perform a reverse DNS lookup using an IP address
nslookup 192.168.1.1

Querying a Specific DNS Server

Specify a particular DNS server for the query. This is useful for testing different DNS resolvers.

# Specify a particular DNS server for the query
nslookup example.com 8.8.8.8

Querying Specific DNS Record Types

Query for a specific type of DNS record, such as MX (Mail Exchange) records for mail servers.

# Query a specific type of DNS record (e.g., MX for mail exchange)
nslookup -query=mx example.com

Setting Query Timeout

Set the timeout duration for waiting for a server response. This can help in diagnosing slow DNS servers.

# Set the timeout duration for waiting for a server response
nslookup -timeout=5 example.com

Querying NS Records

Specify the type of DNS record, here for acquiring the NS (Name Server) records of a domain.

# Specify the type of DNS record, here for acquiring the NS records
nslookup -query=ns example.com

Using Debug Mode

Use debug mode to show detailed diagnostic information about the DNS query and response.

# Use debug mode to show detailed diagnostic information
nslookup -debug example.com

Interactive Mode

Change to interactive mode to issue multiple queries without retyping the command each time. This is efficient for exploring multiple DNS records or servers.

# Change to interactive mode to issue multiple queries
nslookup
# In interactive mode, type `server 8.8.8.8` to use a specific DNS server
# Then, type the domain you want to look up, like `example.com`

Further Resources