Linux / Unix nslookup command

Quick links

About nslookup
Syntax
Examples
Related commands
Linux / Unix main page

About nslookup

Queries a name server for a host or domain lookup.

Syntax

nslookup [ - option ] ... host [ server ]

allList the current settings
d2Set exhaustive debug mode on
nod2Set exhaustive debug mode off
debugSet debug mode on
nodebugSet debug mode off
defnameSet domain-appending mode on
nodefnameSet domain-appending mode off
domain=stringEstablish the appendable domain
ignoretcSet it to ignore packet truncation errors
noignoretcSet it to acknowledge packet truncation errors
hostInquires about the specified host. In this non-interactive command format, nslookup Does not prompt for additional commands.
-Causes nslookup to prompt for more information, such as host names, before sending one or more queries.
serverDirects inquiries to the name server specified here in the command line rather than the one read from the /etc/resolv.conf file. server can be either a name or an Internet address. If the speci- fied host cannot be reached, nslookup resorts to using the name server specified in /etc/resolv.conf.

Examples

This command is often used to perform a reverse lookup on an IP address as shown in the below example.

nslookup 204.228.150.3

Server: 198.60.22.2
Address: 198.60.22.2#53

Non-authoritative answer:
3.150.228.204.in-addr.arpa name = www.computerhope.com.

Authoritative answers can be found from:
150.228.204.in-addr.arpa nameserver = ns.xmission.com.
150.228.204.in-addr.arpa nameserver = ns1.xmission.com.
150.228.204.in-addr.arpa nameserver = ns2.xmission.com.
ns.xmission.com internet address = 166.70.254.2
ns1.xmission.com internet address = 204.228.159.2
ns2.xmission.com internet address = 207.135.133.2

Related commands

dig
host
ping