Network - The nslookup Command


This KB focuses on the Windows nslookup command. However, for Mac and Linux systems the only difference is that you will use Terminal instead of Command Prompt. The commands for nslookup work the same whether you are using Windows, Linux, or Mac systems.
 
The name system lookup or nslookup shows the A record (usually a server name) associated with an IP address and vice versa according to a DNS server.
 
Note: You almost always want to change the DNS server to DNS1.byu.edu (See the bottom of the KB)
 

A basic nslookup (using a local non-authoritative DNS server)

  1. Open a command prompt (Start > Run > type cmd)

  2. Type nslookup and then the hostname or IP address
 

An nslookup on an alias or C name


An nslookup on DNS2-5 (Any DNS server other than DNS1)

  1. Run the following commands.

  2. nslookup,  (enter)

  3. server [DNS server to be queried], (enter)

    1. Ex. "server dns2"

  4. Type the desired name or IP address



    • In this example, the nslookup is querying DNS2 instead of the default DNS1 server.