Starting and Testing the Server


You can start the DNS server in any of the ways discussed in Chapter 4, although it's usually run from a SysV startup script or occasionally from a custom startup script. Running a DNS server from a super server produces slower name lookups, which is undesirable.

A tool that's particularly helpful for testing the operation of a name server is host . This program ships with most Linux distributions, often in a package called bind- utils or something similar. The host utility looks up a name or address using a specified name server. In its simplest form, it uses whatever the default name server is for the computer on which it runs, as specified in /etc/resolv.conf . You can use it by typing its name followed by a hostname or IP address, thus:

 $  host www.awl.com  www.awl.com is a nickname for awl.com awl.com has address 165.193.123.224 

In this example, the first line of output indicates that www.awl.com is an alias (via a CNAME record) for awl.com . This system has the IP address 165.193.123.224. Such a test confirms that the name server is working for outside resolution. If you've configured your own domain, you should test its function using local hostnames and addresses as well. Be sure to test both forward and reverse lookups, if appropriate. You can also look up specific record types by specifying them with the -t option. For instance, to find the MX records for a domain, you might enter a command like the following:

 $  host -t MX awl.com  awl.com mail is handled by 100 mailhost.uu.net. awl.com mail is handled by 10 oldtms702.pearsontc.com. awl.com mail is handled by 20 oldtms701.pearsontc.com. 

This test shows that awl.com has three mail servers ” oldtms702.pearsontc.com has the highest priority (10), followed by oldtms701.pearsontc.com (priority 20), and mailhost.uu.net (priority 100). If you want to test a specific DNS server, you can append its name or IP address to the command, thus:

 $  host www.awl.com spruce  Using domain server: Name: spruce.threeroomco.com Address: 192.168.1.3 Aliases: www.awl.com is a nickname for awl.com awl.com has address 165.193.123.224 

This output is the same as that from the first command, but it adds confirmation that host used a particular DNS server to enter its query.

You can find more information on host from its man page. You may also want to investigate nslookup , which performs a similar function, but is being abandoned in favor of host .



Advanced Linux Networking
Advanced Linux Networking
ISBN: 0201774232
EAN: 2147483647
Year: 2002
Pages: 203

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net