With regard to the cache, you can get dnsmasq stats by sending the daemon the USR1 signal. dnsmasq then dumps some stats to the log file. Here's a little script that I made/use to make it easy:
Code:
#!/bin/bash
kill -s USR1 `cat /var/run/dnsmasq/dnsmasq.pid`
sleep 1
tail -n 5 /var/log/dnsmasq.log
exit 0
Copy and save it as a file, e.g., dns-stats.sh. Make it executable. Then run it (as root) and you'll get something like this:
Code:
[root@serv:~/scripts] ./dns-stats.sh
Jan 10 18:06:33 dnsmasq[680]: time 1357853793
Jan 10 18:06:33 dnsmasq[680]: cache size 2000, 146/89333 cache insertions re-used unexpired cache entries.
Jan 10 18:06:33 dnsmasq[680]: queries forwarded 141965, queries answered locally 99887
Jan 10 18:06:33 dnsmasq[680]: server xxx.79.218.2#53: queries sent 108122, retried or failed 896
Jan 10 18:06:33 dnsmasq[680]: server xxx.79.219.2#53: queries sent 57594, retried or failed 430
The line with 'cache-size' is a bit cryptic. My cache size is 2000. If I'm understanding correctly, the '146/89333' is telling me the size could be increased a bit. Ideally I think it would be '0/89333'.
The other lines are pretty much self-explanatory.