Cached Queries Percentage Statistic on Dashboard

chronometer
logs
dashboard

#1

Not sure how useful it’d be, but part of the reason I love Pi-Hole is that it is a strong caching DNS server.

It would be cool if there was an additional statistic available for the top of the dashboard that showed what % of requests were served from cache.


FTLDNS™: Pi-hole's Own DNS/DHCP server
#2

Do you mean this kind of data? Except on the web UI

$ sudo pkill -USR1 dnsmasq ; sudo tail /var/log/syslog | grep -Po 'dnsmasq.*'
dnsmasq[16392]: time 1489511577
dnsmasq[16392]: cache size 150, 0/10056 cache insertions re-used unexpired cache entries.
dnsmasq[16392]: queries forwarded 9654, queries answered locally 61781
dnsmasq[16392]: queries for authoritative zones 0
dnsmasq[16392]: server 10.xx.xx.2#53: queries sent 3679, retried or failed 31
dnsmasq[16392]: server 10.xx.xx.1#53: queries sent 1765, retried or failed 1

#3

yes!

i’m not sure if “queries answered locally” includes just cache or more-- like resolving local hostnames-- but that looks like it’d be what i’m thinking, but shown on the dashboard in a ratio or percentage format.

a calculation of queries forwarded to upstream vs queries served by cache is exactly what i meant.


#4

This information is already available inside of FTL, but somebody would have to sit down and code the API / web interface integration. I just extended the statistics data that is delivered through the API:

{"domains_being_blocked":104361,"dns_queries_today":5187,"ads_blocked_today":165,"ads_percentage_today":2,"unique_domains":421,"queries_forwarded":2178,"queries_cached":2844}

As you can see

ads_blocked_today + queries_forwarded + queries_cached = dns_queries_today
165               + 2178              + 2844           = 5187

:white_check_mark:

It will become available either in FTL version v1.5.2 or version v1.6


#5

I think this would be a great graph to have in the dashboard. Is it likely to come to the default dashboard at all?


#6

You mean a third Pie chart just showing the ration between those three number? I’m not sure where it should fit. What has been answered from cache and what has been forwarded can already be seen on the dashboard:
Screenshot%20at%202018-04-28%2016-22-46
localhost is my forward destination, local is the sum of everything answered from cache (this includes ads!).

Would you like to see local split into local cache and ads?


#7

See


#8

I like this addition to the ‘Queries Answered by’ chart but I’m curious why I see two of the same DNS names for my configuration of CloudFlare. I have checked my configuration and both the 1.1.1.1 and 1.0.0.1 check boxes are enabled. The output is as:Screenshot%20from%202018-05-01%2013-29-08


#9

Because they misconfigured their DNS host records :laughing:

Pi-hole does everything correct here, 1.0.0.1 is really 1dot1dot1dot1.cloudflare-dns.com.:
Screenshot%20at%202018-05-01%2022-35-42


#10

D’oh! I didn’t even think that it might be ‘them’ so I didn’t check. Sorry about that. I thought I had configured something improperly.