The real status / efficency of the cache seems to be a hot topic in the discussions, due to optimizing the individual setup.
Prerequisite:
Setting log-queries=extra in the dnsmasq config
Trigger :
Call killall -s SIGUSR1 dnsmasq from shell
Output:
Dec 21 14:23:42 dnsmasq[15882]: time 484980
Dec 21 14:23:42 dnsmasq[15882]: cache size 1000000, 0/191 cache insertions re-used unexpired cache entries.
Dec 21 14:23:42 dnsmasq[15882]: queries forwarded 46, queries answered locally 22
Dec 21 14:23:42 dnsmasq[15882]: queries for authoritative zones 0
Dec 21 14:23:42 dnsmasq[15882]: server 156.154.70.1#53: queries sent 46, retried or failed 0
Dec 21 14:23:42 dnsmasq[15882]: server 129.250.35.250#53: queries sent 46, retried or failed 0
Dec 21 14:23:42 dnsmasq[15882]: server 4.2.2.1#53: queries sent 46, retried or failed 0
Dec 21 14:23:42 dnsmasq[15882]: server 8.8.4.4#53: queries sent 46, retried or failed 0
Dec 21 14:23:42 dnsmasq[15882]: server 8.8.8.8#53: queries sent 46, retried or failed 0
Dec 21 14:23:42 dnsmasq[15882]: server 176.95.16.251#53: queries sent 46, retried or failed 0
Dec 21 14:23:42 dnsmasq[15882]: server 176.95.16.235#53: queries sent 46, retried or failed 0
Dec 21 14:23:42 dnsmasq[15882]: Host Address Flags Expires
Dec 21 14:23:42 dnsmasq[15882]: www.bmbuildingpteltd.com 192.168.2.10 4F I H 0
Dec 21 14:23:42 dnsmasq[15882]: heisseempfehlung8.de 192.168.2.10 4F I H 0
Dec 21 14:23:42 dnsmasq[15882]: bigstars-08.com 192.168.2.10 4F I H 0
Dec 21 14:23:42 dnsmasq[15882]: www.freeappandroid.info 192.168.2.10 4F I H 0
Dec 21 14:23:42 dnsmasq[15882]: talented23-writer.xyz 192.168.2.10 4F I H 0
Dec 21 14:23:42 dnsmasq[15882]: revengetalent.com 192.168.2.10 4F I H 0
Dec 21 14:23:42 dnsmasq[15882]: hacking-for-beginners.blogspot 192.168.2.10 4F I H 0
Dec 21 14:23:42 dnsmasq[15882]: freefuckbookszandfa.ru;1 192.168.2.10 4F I H 0
Negogiate:
Output of host records might kill the webfrontend (php process) in my proof of concept. This should be avoided for the "inspect the tail log" feature.
Edit: I have realized that there is already some progress on utilizing the extra logging flag in github, but please consider the negogiation bullet.
which of these statistics would you like to see? Something like queries forwarded 46, queries answered locally 22 could always be reported by FTL without having to have dnsmasq report anything. I doubt that it is important how many domains are currently in dnsmasq's cache, as only the result (ration forwarded/cached) is of interest. This information is already made available in the Forward Destinations (integrated) graph (see local).
I have see serveral post where people were in doubt about their cache has been choosen to small. I also compiled the dnsmasq source to drop the cache limit. The actual status of the cache would be as nice as the load, or the mem consumption or the temperature. What do you think?
You may double check it, but only displaying the log in the frontend is killing php. Maybe bypassing the host section for the log viewer could be an option or a button to poll the cache status ...
They would still go into dnsmasq's log, creating not only a major amount of writing to the disk (which e.g. flash drives don't like too much) but will surely also increase the log file size by several if not dozens of Megabytes each time you click on such a button
I have been reading the man page of dnsmasq a bit more in detail and it tells us:
The cache statistics are also available in the DNS as answers to queries of class CHAOS and type TXT in domain bind. The domain names are cachesize.bind, insertions.bind, evictions.bind, misses.bind, hits.bind, auth.bind and servers.bind. An example command to query this, using the dig utility would be
dig +short chaos txt cachesize.bind
Worth a try? I am writing from my cellphone,... but I will try when christmas activities going to become boring for me.
I did some research on this and it seems quite non-trivial to get this without using some tool like dig... It would be cool to be able to add this inside FTL, but I don't see how to add this right now without having to include a custom library for CHAOS TXT type of queries.