nslookup
queries DNS servers for hostname and IP information
TLDR
SYNOPSIS
nslookup [options] [host] [server]
DESCRIPTION
nslookup queries DNS servers for hostname and IP information. It can perform forward and reverse lookups, query specific record types, and diagnose DNS issues.The tool operates in interactive or non-interactive mode, with interactive mode allowing multiple queries.
PARAMETERS
-type=type
Record type (A, AAAA, MX, NS, TXT, SOA, PTR, ANY, CNAME, SRV).-query=type
Alias for -type.-class=class
DNS class (IN, CH, HS, ANY). Default is IN.-debug
Show debug information (full response packets).-port=port
DNS server port (default 53).-timeout=seconds
Query timeout.-retry=n
Number of retries before giving up.-vc
Use TCP instead of UDP for queries.-nosearch
Do not append the search list to unqualified names.-norecurse
Do not request recursive resolution from the server.-version
Print version and exit.
INTERACTIVE COMMANDS
server name: Set default DNS server (uses current server to resolve it)lserver name: Set default server using the initial serverset type=type: Set query typeset class=class: Set query classset debug / set nodebug: Toggle debug outputset all: Display current option settingsexit: Quit
CAVEATS
Deprecated in favor of dig. Behavior varies by implementation. Interactive mode differs from command line. Some features implementation-specific.
HISTORY
nslookup was written by Andrew Cherenson at UC Berkeley as part of BIND. While still included in most systems, the BIND documentation recommends using dig for DNS queries due to more consistent behavior.
