Minette Pamela wrote: > > > Attached is my script for rebuilding the cache. It is specific to my setup > > but it may be adaptable to suit your needs. You'll probably have to > > 'fromdos <DNSmasqRebuildCache.sh >/usr/sbin/DNSmasqRebuildCache.sh' > > to use it because bash _hates_ CR LF in scripts. > > > > There really should be the equivalent of DUMPCACHE and SLURPCACHE for > > dnsmasq, but if there is anything like that I can't find it, so this is my > > (poor but far better than nothing) substitute. > > > > You can also FTP the script from here: > > ftp://yesican.chsoft.biz/pub/DNSmasqRebuildCache.sh > > -- > > gypsy > > i have added your dnsmasq rebuild cache script and added it to > /usr/sbin but as i have used my dnsmasq, /var/log/DNSmasq is still > empty. what's wrong with it? Did i miss something to add to > configuration files? hope you could help me with it. tnx. > > minette
To use my script you need 3 things: 1) To log queries 2) To log into a file you can read with the script 3) DJBDNS so you have programs dnsip and dnsname. I don't have the URL handy but the site is cryp.to In order to dump the cache to the file, issue killall -USR1 dnsmasq which I put into the rc.dnsmasq script so that a stop dumps the cache. At the end of your dnsmasq.conf, add (or uncomment) a line log-queries I also change the logging to go to /var/log/DNSMasq I posted this to dnsmasq-discuss on 2 June 2005: By default, dnsmasq logs daemon.debug. In /etc/syslog.conf look for debug to see which log file and where located. I dislike daemon.debug so I changed src/config.h to configure logging as local1.debug, then I added local1.* /var/log/DNSmasq to the end of syslog.conf (and restarted the syslog daemon). I don't have the original lines from config.h but here's what is there now: #ifdef LOG_LOCAL0 # define DNSMASQ_LOG_FAC(debug) (debug) ? LOG_DAEMON : LOG_LOCAL1 #else # define DNSMASQ_LOG_FAC(debug) LOG_LOCAL1 #endif -- gypsy