2

I have a BIND name server that has been purposefully enabled for recursion. However, I would like to log all the recursive queries that it handles/forwards.

I am using the following configuration:

logging
{
    channel default_debug {
        file "/var/log/named.log";
        severity dynamic;
        print-time yes;
        print-severity yes;
        print-category yes;
    };
};

Recursive queries are not been written into /var/log/named.log. How can I log recursive queries?

Versions: BIND 9.8.2 on CentOS 6.8.

1

Have you enabled query logging?

As logging every single query is generally seen as undesirable for normal operations it has to be enabled in one of these ways:

  • Specifying the queries category in the logging configuration section.
  • Enabling querylog in the options configuration section.
  • Turning on querylog via rndc at runtime.


As a sidenote the specified path looks problematic. If you want to have named write to a file directly instead of logging via syslog (the default behavior), it's probably better to have a sub-directory dedicated to this (eg /var/log/named/ or similar) as you can then set sensible permissions on that directory.

| improve this answer | |
  • The path is absolutely fine. BIND is running in a chroot environment and I can see log entries. That is not the issue. I have enabled query logging however, like I mentioned, recursive queries are not been logged. Authoritative queries are logged. – user320176 Jul 1 '16 at 12:43
  • @BruceBlacklaws Ok, so no queries logged with + in the last field? – Håkan Lindqvist Jul 1 '16 at 12:47
0

This solved the issue:

category queries { default_debug; };

Recursive queries are now been logged:

01-Jul-2016 20:28:29.758 queries: info: client 1.1.1.1#24009: query: bing.com IN MX + (2.2.2.2)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy