Home arrow Howto's arrow Howto - DNS arrow Howto - Howto use NSLOOKUP
Home
Tools
Knowledge Center
Howto's
Latest Jobs
Latest jobs from IT Contractor Jobs
The latest jobs registered on the IT Contractor Jobs web site.
  • Applications Support Specialist

    - Applications Support Specialist (New Zealand, Wellington - Wellington CBD)

    Applications Support Specialist (ERP) Our client a leading utilities company is after someone who can support and maintain an ERP system. JDE system...

  • Business Analyst

    - Business Analyst (New Zealand, Wellington - Wellington CBD)

    Business Analyst - Financial Markets - 3 months   3 month contract Competitive rates Knowledge of financial markets We are looking for a seasoned Business...

  • Infrastructure Suport Engineer

    - Infrastructure Suport Engineer (New Zealand, Wellington - Wellington CBD)

    Infrastructure Suport Engineer - contract   Our client is looking for an experienced Infrastructure Engineer to provide BAU support in a predominantly Microsoft environment....


Howto - Howto use NSLOOKUP PDF Print E-mail

How to use NSLOOKUP 

nslookup

Note that you may have to give the full pathname. Under SunOS, nslookup lives in the /usr/etc directory; under Ultrix, in /usr/ucb ; and under HP-UX, in /usr/bin .

Once nslookup is running, it prints the name of your default name server and the IP address for that machine, then a > character as a prompt and awaits input:


Server:  Your.Main.Server
Address:  123.45.67.8
>

 

To tell nslookup to look up only MX records, [14] use the set command:

[14] Beginning with V8.7 sendmail , you can also use the /mx command in -bt rule-testing mode to look up MX records.


>

set type=mx

>

Now look up some real hosts and domains. First look up the domain sendmail.org by entering its name at the prompt:


>

sendmail.org.

 

Note the trailing dot that tells nslookup (1) that the local, default domain should not be appended prior to the lookup. The output produced by the above lookup looks like this:


>

sendmail.org.

Server:
Address:  123.45.67.8
sendmail.org    preference = 20, mail exchanger = mail1.reference.com
sendmail.org    preference = 30, mail exchanger = mail2.reference.com
sendmail.org    preference = 10, mail exchanger = mail.mailsite.rutgers.edu
mail1.reference.com     inet address = 206.171.3.24
mail2.reference.com     inet address = 128.102.240.18
mail.mailsite.rutgers.edu     inet address = 204.247.98.2
>

The first two lines again show the name and IP address of the local DNS server. The next three lines show that the domain sendmail.org has three MX records. Mail addressed to that domain is sent to the machine with the lowest preference (cost), which happens to be mail.mailsite.rutgers.edu . [15] If that machine is down (or not accepting mail), the message is sent to the machine with the next higher cost, mail1.reference.com . The last three lines show the IP addresses (A records) for those machines.

[15] Note that case is not significant in domain names; all of the following are the same: org , OrG , ORG .

Now look up a real UUCP host, www . Enter its name as if it were a part of the yahoo.com domain:


>

www.yahoo.com.

 

The output produced shows that www has an MX record:


www.yahoo.com   preference = 5, mail exchanger = .yahoo.com
.yahoo.com inet address = 128.32.201.15
>

Mail sent to www.yahoo.com is instead delivered to the machine named .yahoo.com , which in turn forwards that mail over a dial-up line to the UUCP host www .

Machines that have MX records do not necessarily have A records. The host www is such a machine. You tell nslookup (1) to look up an A record with the set command:


>

set type=a

>

www.yahoo.com.


*** No address information available for www.yahoo.com.

The nslookup (1) program is a useful tool for performing all the same lookups that are done by sendmail . Each type of lookup corresponds to a set type . The list of some available nslookup .

Table: Some nslookup Types  Type Description
a IP address
cname Canonical name for an alias
hinfo Host CPU and operating system type
mx Mail exchanger records
ns Name server record
any Union of all records

To exit nslookup (1), just type exit (or Control-D if that fails).

 
< Prev   Next >
Powered by IT CONTRACTORS and designed by EZPrinting web hosting