Copyright (C) 2011 by Steve Litt, All rights reserved. Material provided as-is, use at your own risk.
CONTENTS: |
./run; log/runYou can run and test daemontools on its own with a test service, but this is covered later in this document. Anyway, the point is that within a couple minutes you're narrowed the root cause scope down to one major component, making for much easier troubleshooting.
TEST |
MEANING |
ping 8.8.8,8 |
See if you can hit the Internet
by pinging the main Google public DNS. If you can't ping by IP address,
you have deeper problems and no local DNS resolver will work. If this
doesn't ping, fix it before going on. |
dig @8.8.8.8 -x 8.8.8.8 |
Make sure that the Google public DNS at 8.8.8.8 reverse-resolves itself. If not, you have a very wierd problem: investigate. |
dig @192.168.100.2 -x 8.8.8.8 | Try
to reverse-resolve Google's public DNS server at 8.8.8.8, using your
dnscache at 192.168.100.2. The answer should be something like google-public-dns-a.google.com. If this doesn't work, your resolver (dnscache) is not working. |
dig @192.168.100.2 google.com |
Try to resolve google.com using your dnscache. The answer should be a list of several IP addresses. If this doesn't work, your resolver (dnscache) is not running or not working. |
dig @127.0.0.1 wincli.domain.cxm |
Query for mydesk.domain.cxm on
your authoritative DNS server (tinydns) at 127.0.0.1. The answer should be
192.168.100.5. If this doesn't work, your authoritative server
(dnscache) is not working or is misconfigured. |
dig @127.0.0.1 -x 192.168.100.5 | Reverse-query for 192.168.100.5 on your authoritative DNS server (tinydns) at 127.0.0.1. The answer should be wincli.domain.cxm.
If this doesn't work, your authoritative server (dnscache) is not
working or is misconfigured. NOTE: If the forward authoritative query works but not the reverse, or vice versa, it's probably a misconfigured tinydns rather than a nonfunctional one. Fix the /service/tinydns/root/data file, and then from within /service/tinydns/root directory, run make. |
ps ax | grep svscan |
On standard installations this command should produce a line of output looking like this: 1031 ? S 0:21 svscan /service If the directory after the word svscan is anything other than /service, then you have a non-standard installation, and you need to carefully evaluate everything. In this document, everywhere I use the directory /service, it's because that's the directory listed in the svscan process. If that process lists another directory, either all symlinks must be to that directory, or you must change your bootup to run svscan on directory /service. |
SITUATION |
TEST | MEANING |
If dnscache didn't work |
ps ax | grep dnscache | This shows what dnscache software is running. If everything's correct, it should look like this: slitt@mydesk:~$ ps ax | grep dnscache 568 pts/22 S+ 0:00 grep dnscache 30977 ? S 0:00 supervise dnscache 30979 ? S 0:19 /usr/local/bin/dnscache slitt@mydesk: If you don't see the line referring to /usr/local/bin/dnscache, your dnscache software is not running and that's why you cannot forward or backward resolve. If you also don't see the line referring to supervise dnscache, that's an indication that the root cause resides in the daemontools software, and there may be nothing wrong with your dnscache. |
If the supervise dnscache line is there but not the /usr/local/bin/dnscache |
svc -u /var/djb/service/dnscache sleep 5 ps ax | grep dnscache dig @192.168.100.2 google.com |
Dnscache might have
just been turned off, in which case the first command turns it back on.
It might take as long as 5 seconds to turn it back on, hence the sleep command. The final two commands test to see whether dnscache now works. |
If the preceding test failed to fix the problem, or if there was no supervise dnscache process |
cd /var/djb/service/dnscache ./run ## CHECK FOR ERROR MESSAGES ps ax | grep /usr/local/bin/dnscache dig @192.168.100.2 google.com |
Here you're running
dnscache without using daemontools. You are NOT running the dnscache
logging facility. You're running dnscache in the foreground, so you can
see and correct all error messages. Also, whenever you query this
dnscache, you'll see what would normally go into the log. The final two
lines check whether dnscache can work on its own, without daemontools. If you need to shut off this foreground process, just type Ctrl+C to stop it. |
If dnscache still doesn't work |
ps ax | grep dnscache | If you see multiple instances of supervise dnscache or /usr/local/bin/dnscache, that could be causing dnscache to malfunction. See the section titled Killing Multiple Instances. |
If you got dnscache working |
If
you got it working with the svc -u command, all is well. If you had to
do the ./run command, that means that dnscache works OK on its own, but
it's not being reliably started by daemontools. See the section titled Troubleshooting Daemontools Problems. |
SITUATION |
TEST | MEANING |
If tinydns didn't work |
ps ax | grep tinydns | This shows what dnscache software is running. If everything's correct, it should look like this: slitt@mydesk:~$ ps ax | grep tinydns 21550 pts/22 S+ 0:00 grep tinydns 30932 ? S 0:00 supervise tinydns 30935 ? S 0:00 /usr/local/bin/tinydns slitt@mydesk: If you don't see the line referring to /usr/local/bin/tinydns, your tinydns software is not running and that's why authoritative DNS isn't working. If you also don't see the line referring to supervise tinydns, that's an indication that the root cause resides in the daemontools software, and there may be nothing wrong with your tinydns. If you see more than one of either, see the section titled Killing Multiple Instances. If you see exactly one of each, that's an indication that your tinydns would work just fine if only it were configured correctly, in which case you should see the section titled Configuring Your data File. |
If the supervise tinydns line is there but not the /usr/local/bin/tinydns | svc -u /var/djb/service/tinydns sleep 5 ps ax | grep tinydns dig @127.0.0.1 wincli.domain.cxm |
Tinydns might have just been turned off, in which case the first command turns it back on. It might take as long as 5 seconds to turn it back on, hence the sleep command. The final two commands test to see whether tinydns now works. |
If the preceding test failed to fix the problem, or if there was no supervise tinydns process | cd /var/djb/service/tinydns ./run ## CHECK FOR ERROR MESSAGES ps ax | grep /usr/local/bin/tinydns dig @127.0.0.1 wincli.domain.cxm |
Here you're running tinydns without using daemontools. You are NOT running the tinydns
logging facility. You're running tinydns in the foreground, so you can
see and correct all error messages. Also, whenever you query this
tinydns, you'll see what would normally go into the log. The final two
lines check whether tinydns can work on its own, without daemontools. If you need to shut off this foreground process, just type Ctrl+C to stop it. |
If tinydns still doesn't work | ps ax | grep dnscache | If you see multiple instances of supervise tinydns or /usr/local/bin/tinydns, that could be causing tinydns to malfunction. See the section titled Killing Multiple Instances. |
If you got dnscache working | If you got it working with the svc -u command, all is well. If you had to do the ./run command, that means that tinydns works OK on its own, but it's not being reliably started by daemontools. See the section titled Troubleshooting Daemontools Problems |
SITUATION |
TEST | MEANING | ||
SITUATION |
TEST | MEANING | ||