nslookup
queries DNS servers for hostname and IP information
TLDR
Lookup IP address
$ nslookup [example.com]
Lookup using specific DNS server$ nslookup [example.com] [8.8.8.8]
Reverse DNS lookup$ nslookup [192.168.1.1]
Query specific record type$ nslookup -type=[MX] [example.com]
Interactive mode$ nslookup
Debug mode$ nslookup -debug [example.com]
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).-query= type
Alias for -type.-debug
Show debug information.-port= port
DNS server port.-timeout= seconds
Query timeout.-retry= n
Number of retries.
INTERACTIVE COMMANDS
server name: Set DNS serverset type= type: Set query typeset debug: Enable debugexit: 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.
