The nslookup command is a powerful network administration tool used for querying the Domain Name System (DNS) to obtain domain-related information. Whether you’re troubleshooting DNS issues on a VPS hosting plan or managing domains on a dedicated server, understanding how to use nslookup effectively can help diagnose and resolve network-related problems.
The nslookup (Name Server Lookup) command is used to query DNS records, retrieve IP addresses of a domain, and check various DNS configurations. It is available by default on both Windows and Linux operating systems.
To use nslookup on Windows, open the Command Prompt by pressing:
Win + R -> type 'cmd' -> Enter
Alternatively, you can search for “Command Prompt” in the Start menu.
To find the IP address of a website, use the following command:
nslookup example.com
To retrieve the mail server records (MX records) for a domain:
nslookup -query=mx example.com
To check which name servers are responsible for a domain:
nslookup -query=ns example.com
If you have an IP address and need to determine its associated domain:
nslookup 192.168.1.1
The nslookup command is also available on Linux and works similarly to Windows.
To use nslookup on Linux, open a terminal window by pressing:
Ctrl + Alt + T
To look up the IP address of a domain:
nslookup example.com
To find out which mail servers handle email for a domain:
nslookup -query=mx example.com
To check which name servers are associated with a domain:
nslookup -query=ns example.com
If you have an IP address and need to find its associated hostname:
nslookup 192.168.1.1
By default, nslookup uses the system-configured DNS server. To query a specific DNS server, use:
nslookup example.com 8.8.8.8
This will use Google’s public DNS (8.8.8.8) to resolve the domain.
To enter interactive mode, simply type nslookup and press Enter:
nslookup
Then, you can enter multiple queries without exiting the tool.
To retrieve all available DNS records for a domain:
nslookup -query=any example.com
The nslookup command is an essential tool for diagnosing DNS-related issues and verifying domain configurations. Whether you’re working with VPS hosting or a dedicated server, mastering nslookup can significantly improve your network troubleshooting skills and domain management efficiency.