Nslookup
Encyclopedia
nslookup is a network administration command-line tool available for many computer operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s for querying the Domain Name System
Domain name system
The Domain Name System is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities...

 (DNS) to obtain domain name
Domain name
A domain name is an identification string that defines a realm of administrative autonomy, authority, or control in the Internet. Domain names are formed by the rules and procedures of the Domain Name System ....

 or IP address
IP address
An Internet Protocol address is a numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing...

 mapping or for any other specific DNS record.

Background

The name nslookup means name server lookup. Nslookup uses the operating system's local Domain Name System resolver library to perform its queries. Thus, it is configured automatically by the contents of the operating system file resolv.conf
Resolv.conf
resolv.conf is the name of a computer file used in various operating systems to configure the Domain Name System resolver library. The file is a plain-text file usually created by the network administrator or by applications that manage the configuration tasks of the system...

.

Even though the nslookup program is very old, its usage is still taught in computer courses such as the Cisco Networking Academy
Cisco networking academy
Cisco Networking Academy, a global education initiative from Cisco Systems, offers networking programs, like the CCNA and CCNP courses, which prepare students for the certification exams of the same name, and other computer-related courses...

, and it is still installed by default on most versions of Windows including Windows XP
Windows XP
Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...

, Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

, and Windows 7.

Usage

nslookup operates in interactive or non-interactive mode. When used interactively, when the program is invoked without arguments (another option exists), the user issues parameter configurations or requests when presented the nslookup prompt ('>') in line by line fashion. In non-interactive mode parameters and the query are specified as command line arguments in the invocation of the program.

The general command syntax is:

nslookup [-option] [name | -] [server]

Example

The following example queries the Domain Name System for the IP address
IP address
An Internet Protocol address is a numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing...

 of the domain name example.com by issuing the command nslookup example.com to the command line interpreter (shell):

$ nslookup example.com
Server: 192.168.0.254
Address: 192.168.0.254#53

Non-authoritative answer:
Name: example.com
Address: 192.0.32.10


This is an example of interactive, prompted use of the nslookup application. The user executes the program without any arguments and issues parameters and queries at the program prompt ('>'):

$ nslookup
Default Server: dsldevice.lan
Address: 192.168.1.1

> server 8.8.8.8
Default Server: google-public-dns-a.google.com
Address: 8.8.8.8

> set type=mx
> wikipedia.org
Server: google-public-dns-a.google.com
Address: 8.8.8.8

Non-authoritative answer:
wikipedia.org MX preference = 10, mail exchanger = mchenry.wikimedia.org
wikipedia.org MX preference = 50, mail exchanger = lists.wikimedia.org
> exit

In this example, the program first displays its default name server configuration, after which the user changes the name server to be used to the host at IP address 8.8.8.8. The type of query to be performed is specified by setting the type of record to be fetched (MX record
MX record
A mail exchanger record is a type of resource record in the Domain Name System that specifies a mail server responsible for accepting email messages on behalf of a recipient's domain, and a preference value used to prioritize mail delivery if multiple mail servers are available...

). Finally, the user simply issues the domain name at the prompt to receive the query results. The command exit ends the interactive session and terminates the program.

See also

  • Domain Information Groper
    Domain Information Groper
    Domain Information Groper is a network administration command-line tool for querying Domain Name System name servers for any desired DNS records....

     (dig)
  • whois
    WHOIS
    WHOIS is a query and response protocol that is widely used for querying databases that store the registered users or assignees of an Internet resource, such as a domain name, an IP address block, or an autonomous system, but is also used for a wider range of other information. The protocol stores...

  • host (Unix)
    Host (Unix)
    host is a simple utility for performing Domain Name System lookups. It was developed by the Internet Systems Consortium , and is released under the ISC license, a permissive free software license....

    , a simple utility for performing Domain Name System lookups

External links

  • Microsoft Windows
    • nslookupMicrosoft TechNet
      Microsoft TechNet
      Microsoft TechNet is a Microsoft program and resource for technical information, news, and events for IT professionals. Along with a website, they also produce a monthly subscription magazine titled "TechNet Magazine"....

      library
    • Using NSlookup.exe - Microsoft Knowledgebase
  • Unix-like OSs
  • Other
    • (includes web-version of nslookup)
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK