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 is a nickname for has address 

In this example, the first line of output indicates that is an alias (via a CNAME record) for . This system has the IP address 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 mail is handled by 100 mail is handled by 10 mail is handled by 20 

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

 $  host spruce  Using domain server: Name: Address: Aliases: is a nickname for has address 

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 © 2008-2017.
If you may any questions please contact us: