How do you open up debug logging for BIND on Ubuntu?

Solution 1:

How to see what's going on:

  • To view what the server is doing live, if you have rndc configured run rndc trace x (where x is the debugging level you want to view).

  • To view what the server is doing live without rndc you'll have to run the server in foreground mode named -g -d x (where x is again is the debug level).

  • To configure logging to a file, open named.conf and edit/add a logging section such as:

    logging {
            channel default_file {
                    file "/var/log/named.log" size 10m;
                    severity info;
                    print-time yes;
                    print-severity yes;
                    print-category yes;
            };
            category default{ default_file; };
    };
    

    Note that this configures the logging for "info" level and higher. This dumps quite a bit of information for a live server. Possible values include "extra", "debug", "info", "error", "fatal", and "dynamic" (a value for -d must be provided on the command line for dynamic).

What's wrong with your server:

Your server is looping back to itself while trying to recursively resolve the domain. Since this is only happening for one domain that you know if, it's likely a problem in your hosts file or in your named.conf file (probably the latter).

Getting request failed: duplicate query is almost always a problem with a forwarders directive that loops back to the server or something similar.

Solution 2:

This may be a cache problem. Have you tried to flush cache?

rndc flush # all entries

rndc flushname microsoft.com # all entries for microsoft.com supported from bind 9.3