Ich habe keinen Zugriff auf, dnsmasqaber laut diesem Thread mit dem Titel: dnsmasq ist es Caching? Sie können das Signal USR1 an den dnsmasqProzess senden , wodurch die Statistiken in das Systemprotokoll geschrieben werden.
$ sudo pkill -USR1 dnsmasq
Dann konsultieren Sie die Systemprotokolle:
$ sudo tail /var/log/syslog
Jan 21 13:37:57 dnsmasq[29469]: time 1232566677
Jan 21 13:37:57 dnsmasq[29469]: cache size 150, 0/475 cache insertions re-used unexpired cache entries.
Jan 21 13:37:57 dnsmasq[29469]: queries forwarded 392, queries answered locally 16
Jan 21 13:37:57 dnsmasq[29469]: server 208.67.222.222#53: queries sent 206, retried or failed 12
Jan 21 13:37:57 dnsmasq[29469]: server 208.67.220.220#53: queries sent 210, retried or failed 6
HINWEIS: Ich glaube, dass dnsmasqder Cache im RAM bleibt.
Wenn Sie den Cache sichern möchten, müssen Sie den -qSchalter beim dnsmasqAufrufen aktivieren . Dies wird in der dnsmasqManpage erwähnt:
-d, --no-daemon
Debug mode: don't fork to the background, don't write a pid file,
don't change user id, generate a complete cache dump on
receipt on SIGUSR1, log to stderr as well as syslog, don't fork new
processes to handle TCP queries. Note that this option is for use in
debugging only, to stop dnsmasq daemonising in production, use -k.
-q, --log-queries
Log the results of DNS queries handled by dnsmasq. Enable a full
cache dump on receipt of SIGUSR1.