I'm using bind 9.8 (BIND 9.8.2rc1-RedHat-9.8.2-0.37.rc1.el6_7.6). How can I log failed lookups? i.e. lookups that do not have an A record? We have a pretty long DNS chain that sometimes fails (network errors etc), and we'd like to be able to know when queries are failing to get looked up (i.e. the first DNS server works, the parent to that DNS works also, but maybe the parent to that one is down due to a network error etc so the query does not return an A record).
I have tried to enable everything (see config below) but all I get in the query.log when looking up a non-existing domain is this (ip's sanitized):
12-Sep-2022 07:16:17.315 queries: info: client 10.ZZ.XX.YY.#60029: query: blahblahtest.com IN A + (10.ZZ.XX.YY)
The blahblahtest.com domain doesn't have an A record, so I need to be able to see when this is the case. But this query looks exactly like other queries that do have an A record, so how do I distinguish them.
Is this even possible?
logging {
channel default_debug {
print-time yes;
print-category yes;
print-severity yes;
file "data/named.run";
severity dynamic;
};
channel query_log {
file "data/query.log";
severity debug;
};
channel default_syslog {
print-time yes;
print-category yes;
print-severity yes;
syslog daemon;
severity info;
};
#client Processing of client requests.
category client { default_debug; default_syslog; };
#config Configuration file parsing and processing.
category config { default_debug; default_syslog; };
#database Messages relating to the databases used internally by the name server to store zone and cache data.
category database { default_debug; default_syslog; };
#default Logs all values which are not explicitly defined in category statements i.e. if this is the only category defined it will log all categories listed in this table with the exception of queries which are not turned on by default.
category default { default_debug; default_syslog; };
#delegation-only Logs queries that have returned NXDOMAIN as the result of a delegation-only zone or a delegation-only statement in a hint or stub zone declaration.
category delegation-only { default_debug; default_syslog; };
#dispatch Dispatching of incoming packets to the server modules where they are to be processed.
category dispatch { default_debug; default_syslog; };
#dnssec DNSSEC and TSIG protocol processing.
category dnssec { default_debug; default_syslog; };
#general Anything that is not classified as any other item in this list defaults to this category..
category general { default_debug; default_syslog; };
#lame-servers Lame servers. Mis-configuration in the delegation of domains discovered by BIND 9 when trying to authoritative answers. If the volume of these messages is high many users elect to send them to the null channel e.g. category lame-servers {null;}; statement.
category lame-servers { default_debug; default_syslog; };
#network Logs all network operations.
category network { default_debug; default_syslog; };
#notify Logs all NOTIFY operations.
category notify { default_debug; default_syslog; };
#queries Logs all query transactions. The querylog statement may be used to override this category statement. This entry can generate a substantial volume of data very quickly. This category is not turned on by default and hence the default type above will not log this information.
category queries { query_log; };
#resolver Name resolution including recursive lookups performed on behalf of clients by a caching name server.
category resolver { default_debug; default_syslog; };
#rpz All operations related to Response Policy Zone (RPZ) processing. Even when RPZ zones are disabled (using policy disabled parameter in the response-policy statement) the operation is completed, logged then discarded (the real response is returned to the user).
category rpz { default_debug; default_syslog; };
#rate-limit All operations related to one or more rate-limit statements in the options or view clauses.
category rate-limit { default_debug; default_syslog; };
#security Approval and denial of requests.
category security { default_debug; default_syslog; };
#unmatched No matching view clause or unrecognized class value. A one line summary is also logged to the client category. By #default this category is sent to the null channel.
category unmatched { default_debug; default_syslog; };
#update Logging of all dynamic update (DDNS) transactions.
category update { default_debug; default_syslog; };
#update-security Approval and denial of update requests used with DDNS.
category update-security { default_debug; default_syslog; };
#xfer-in Details of zone transfers the server is receiving.
category xfer-in { default_debug; default_syslog; };
#xfer-out Details of zone transfers the server is sending.
category xfer-out { default_debug; default_syslog; };
};