-
Stands for: Name Server Lookup
-
Purpose: to get information about domain names, IP addresses and DNS records by querying DNS servers
-
Use: diagnosing network problems, verifying domain configurations, checking mail servers
💻 Basic Usage
🔹 Finding the IP Address of a Domain
nslookup example.com
example.comShows the IP address that corresponds to this domain name.
🔹 Finding the Domain Name of an IP Address (Reverse DNS)
nslookup 8.8.8.8
Shows the domain name information of the Google DNS server.
🔹 Querying Specific DNS Records
-
MX (Mail Exchange) Record:
nslookup -query=mx example.com
-
NS (Name Server) Record:
nslookup -query=ns example.com
-
CNAME (Canonical Name) Record:
nslookup -query=cname www.example.com
-
ANY (All records):
nslookup -query=any example.com
⚙️ Advanced Usage
🔸 Querying with a Specific DNS Server
nslookup example.com 8.8.8.8
example.comqueries this domain name via the Google DNS server (8.8.8.8).
🔸 Interactive Mode
nslookup
After typing the command, you enter interactive mode. Then you type your queries:
> set type=mx
> example.com
📌 Useful Parameters
| Parameter | Description |
|---|---|
-query=TYPE |
Specifies the query type (A, MX, NS, CNAME, ANY) |
-timeout=SECONDS |
Timeout |
-port=NUMBER |
Port to use for the DNS query (default: 53) |
-debug |
Detailed query output |
Nslookup is built into both Windows and Linux systems. It is an indispensable tool for network administrators, system specialists and technical support teams.
