O'Reilly logo

Sendmail, 3rd Edition by Bryan Costales

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to Use nslookup

If your site is connected to the Internet, you can use the nslookup(1) program to interactively find MX and other records. To run nslookup, just type its name:

% nslookup

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

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,[12] use the set command:

> 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 this lookup looks like this:

> sendmail.org.
Server:  Your.Main.Server
Address:  123.45.67.8

sendmail.org    preference = 10, mail exchanger = smtp.neophilic.com
sendmail.org    preference = 20, mail exchanger = smtp.gshapiro.net
sendmail.org    preference = 100, mail exchanger = playground.sun.com
smtp.neophilic.com      internet address = 209.31.233.176
smtp.gshapiro.net       internet address = 209.220.147.178
playground.sun.com      internet address = 192.9.5.5
>

The first two lines again show the name and IP address of the local DNS server. The next ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required