nslookup is a command-line tool used to query DNS (Domain Name System). It lets you find the IP address of a domain, perform reverse lookups, and query specific DNS records.
Query a specific DNS server Find the IP address (A record) Find IPv6 address (AAAA record) Find MX (Mail Exchange) records Find NS (Name Server) records Find TXT records
On this page
- Query a specific DNS server
- Find the IP address (A record)
- Find IPv6 address (AAAA record)
- Find MX (Mail Exchange) records
- Find NS (Name Server) records
- Find TXT records
- Find CNAME
- Reverse DNS lookup
- Given an IP address, find the hostname.
- Check if a domain resolves
- Troubleshooting with different DNS servers
- Compare results from different resolvers:
bash
nslookup google.comQuery a specific DNS server
bash
nslookup google.com 8.8.8.8Find the IP address (A record)
bash
nslookup -type=A google.comFind IPv6 address (AAAA record)
bash
nslookup -type=AAAA google.comFind MX (Mail Exchange) records
bash
nslookup -type=MX gmail.comFind NS (Name Server) records
bash
nslookup -type=NS google.comFind TXT records
bash
nslookup -type=TXT google.com#Useful for checking:
- SPF
- DKIM
- Domain verification
Find CNAME
bash
nslookup -type=CNAME www.github.comReverse DNS lookup
Given an IP address, find the hostname.
bash
nslookup 8.8.8.8Check if a domain resolves
bash
nslookup example.comTroubleshooting with different DNS servers
Compare results from different resolvers:
bash
nslookup example.com 8.8.8.8
nslookup example.com 1.1.1.1
nslookup example.com 9.9.9.9text
Common record types
Type Purpose
A IPv4 address
AAAA IPv6 address
MX Mail server
NS Name servers
TXT Text records (SPF, DKIM, verification)
CNAME Canonical name (alias)
SOA Start of Authority
PTR Reverse DNS lookuplinux-command/nslookup.md
Related articles
- WindowsFormatting a USB drive completely wipes all data on it and sets up a fresh file system. In Windows, you can do this quickly using either the graphical interface or the command line1.Right-click the Start menu and select Terminal (Admin) or Command Prompt (Admin). 2.Type diskpart and press Enter. 3.Run the following commands one by one:
- Linux CommandFinding a Specific PortUsing lsof (List Open Files):
- Linux CommandTo list running services with systemctl, you want to filter for services (--type=service) that are currently active (--state=running).List ALL Active Services (Running or Exited): List ALL Installed Services (Running, Stopped, or Disabled) Finding a Specific Service The Cleanup Process Stop the service Disable…
- Linux CommandCreate the user and home directory in arch linuxSet passworrd