The name server keeps track of various statistics. You can print these statistics to the file
/var/tmp/named.statsby issuing the following command:
Statistics are appended to the file. The statistics look similar to this:
time since boot (secs) 1273431
time since reset (secs) 29802 input packets 326031 output packets 327165 queries 284353 iqueries 0 duplicate queries 214 responses 50109 duplicate responses 70 OK answers 220220 FAIL answers 63919 FORMERR answers 0 system queries 23
prime cache calls 4
check_ns calls 4
bad responses dropped 0
martian responses 0
Unknown query types 0 A queries 47921 CNAME queries 2054 SOA queries 8216 PTR queries 35909 MX queries 10569 AXFR queries 424 ANY queries 179263
The first two lines print out the number of seconds that the name server has been running and the number of seconds since the last restart caused by a SIGHUP signal. To convert these values to days, divide by 86,400 (the number of seconds in a day).
input packetsis the number of datagrams received by the name server. The datagrams come from the resolver code compiled into the services and from queries and responses from other name servers.
output packetsis the number of datagrams sent by the name server. These datagrams are responses to resolver queries, queries from other name servers, and system queries. Because queries to other name servers may not be answered, there will probably be more output packets than input packets.
queriesis the number of queries received by this name server. Because the name server can handle datagram and stream connections, there can be more queries than input packets. The total number of queries is the sum of all the counts of different query types listed in this statistics dump, starting with unknown query types.
iqueriesis the number of inverse queries. Inverse queries can be used to map a host address to a domain name, although PTR queries are the normal method. Some versions of nslookup send inverse queries when they are starting up.
duplicate queriesare retransmitted queries for pending lookups that the resolver sends to the name server. The name server detects the duplicate queries and discards them.
responsesis the number of response packets that the name server receives from queries to other name servers.
duplicate responsesare response packets from remote name servers for queries that are no longer pending. The name server retransmits queries to remote name servers. If the remote server responds to the original query and responds to the retransmitted query, the local name server discards the second response as a duplicate.
OK answersis the number of responses to queries that contain some information.
FAIL answersis the number of responses indicating either that the name does not exist or that there is no data of the requested type for this name.
FORMERR answersis the number of malformed response packets from other name servers. A message is sent to the syslog daemon listing the sender of the malformed response packet. system queriesare queries generated by the name server. These usually occur when the name server detects another name server listed for a domain for which there is no address data. The system query is an attempt to find the address data for that name server. System queries are also used to keep up-to-date information about the name servers for the root domain.
prime cache callsare calls to update the information about the name servers for the root domain.
check_ns callsare calls to check the state of the information about the name servers for the root domain.
bad responses droppedare responses from remote name servers that are dropped. These occur most often when the remote name server responds with SERVFAIL, indicating a problem with the server’s domain data.
martian responsesare responses from unexpected addresses. The name server keeps track of how long it takes for a remote name server to respond. If the remote name server is a
multi-homed host, a query to one of the addresses may result in a response from another of its addresses. If the local server does not know about this other address, the response is counted as a martian response.
unknown query typesare queries for data types unknown to this server.
A queriesare queries for the host address for a domain name. The gethostbyname library routine generates these address queries.
CNAME queriesare queries for the canonical name for a domain name. Some versions of sendmailquery for CNAME records during name canonicalization from $[$] tokens in
/var/adm/sendmail/sendmail.cf.
SOA queriesare queries for the start of authority records. These queries are most often made by slave servers over a stream connection to check if their domain data is current.
PTR queriesare queries for the domain name for a host address. The gethostbyaddr library routine generates these queries.
MX queriesare mail exchanger queries made by sendmail during the delivery of electronic mail.
AXFR queriesare the number of zone transfers done by slave servers. A slave server first makes an SOA query and follows that with an AXFR query if new domain data should be transferred.
ANY queriesare queries for any data associated with the domain name. Some versions of sendmailmake queries for ANY data during name canonicalization from $[$] tokens in /var/adm/sendmail/sendmail.cf.