Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is my DNS server working?

Status
Not open for further replies.

SelbyGlenn

Technical User
Oct 7, 2002
444
0
0
GB
Hi there,

Is there any way of telling how many queries a Name Server has had since its been up? I'm not interested at who's querying and I don't want to log everything as the logs will become huge. All I am after is the total number of hits since the server has been up. I am running BIND 9 on RH7.3.

Thanks in advance,

Glenn
BEng MCSE CCA
 
In your /etc/named.conf file add, in the 'options' section:

options {
...
zone-statistics yes;
host-statistics yes;
...
};

(of course the '...' means other stuff may be there).

You can also add the 'statistics-interval <seconds>;' options to have it automagically create statistics at even internvals. Statistics files will be placed in your 'directory <dirname>;' entry (also in the options stanza).

Now, you can force outputting of the statistics with a 'rndc' command. The command option is 'rndc stats'. If you just want host level stuff, just use the 'host-statistics' option, but I find zone statistics to be useful.

Anyhow, if you do run at even intervals (the 'statistics-interval' option), I highly suggest adding log maintenance under logrotate, such as an /etc/logrotate.d file similar to:

/var/log/named.log {
missingok
postrotate
/bin/kill -HUP `cat /var/named/named.pid 2> /dev/null` 2> /dev/null || true
endscript
}

/var/named/named.stats {
missingok
}


Hope this helps!

---
Batavus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top