So how do you isolate the problem when you've determined that the problem with the DNS records is on your nameserver? The first thing to do is to make sure that the nameserver is running and determine where the configuration and zone files are stored. The easiest way to do this is to run the command You should see something like
Code:
named 5635 0.0 0.0 69616 4400 ? Ssl Jul13 0:29 /usr/sbin/named -u named -t /var/named/chroot
root 5406 0.0 0.0 1604 512 ttyp0 S+ 10:43 0:00 \_ grep named
or
Code:
named 5635 0.0 0.0 69616 4400 ? Ssl Jul13 0:29 /usr/sbin/named -u named
root 5406 0.0 0.0 1604 512 ttyp0 S+ 10:43 0:00 \_ grep named
If you don't see any output and just get the command line back (or only see the grep process), then named isn't running, and should be restarted.
If you do see the named process listed, you want to check if there is a '-t' option in the output, like the "-t /var/named/chroot" in the first example above. If it is there this tells you that the nameserver has been chroot'd, which will change the location of the files you need to look at. From this point on I'll assume that named hasn't been chroot'd, and refer to the default locations. If named has been placed in a chroot jail, prepend the directory listed after the '-t' option to any paths listed below.
Once you're certain that named is actually running, you want to check the config file, which is typically /etc/named.conf . The two things you want to make sure of in regards to the named.conf file is that the file's syntax is ok, and that it has a zone entry for the domain you are trying to troubleshoot. You can check the file's syntax using the named-checkconf command. The basic syntax for the command is
Code:
named-checkconf </path/to/named.conf>
If the syntax is ok there won't be any output, and you'll just get a prompt back. If there are problems you'll get a message complaining about those errors.
You should then look through the file to make sure that there is a zone section for the domain in question. A basic zone definition should look something like
Code:
zone "example.com" {
type master;
file "/var/named/example.com.db";
};
This example tells the nameserver that it is the master nameserver for the domain example.com, and that the file containing the DNS records for the domain is located at /var/named/example.com.db.
If you've gotten this far and still need to determine why a domain's records aren't resolving correctly, it's time to look at the file holding the domain's DNS records, typically called a zone file.
To start you should use the named-checkzone command. Like the named-checkconf command checks named's config file, this checks a zone file to make sure that it syntax is correct. The basic way to run the command is
Code:
named-checkzone <zone> <zone_file>
This will make sure that the syntax for the file is correct.
If you've run all of the checks above and still can't determine the problem, you may need to check if the nameserver is using views, which can cause problems if not setup correctly. If you're sure that views aren't the problem, and still can't determine why a domain isn't resolving, you're facing an unusual problem, and will need to look at the server's log files to determine why things aren't working correctly.
Bookmarks