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:
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: 126.96.36.199 >
To tell nslookup to look up only MX records, use the set command:
Now look up some real hosts and domains. First look up the domain sendmail.org by entering its name at the prompt:
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: 188.8.131.52 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 = 184.108.40.206 smtp.gshapiro.net internet address = 220.127.116.11 playground.sun.com internet address = 18.104.22.168 >
The first two lines again show the name and IP address of the local DNS server. The next ...