About statistics

Hello,

I discover pi-hole and that's nice.
I search about statistics before posting but do not found a correct and valid answer. May be I was wrong / sorry

The default displays the current 24 hours statistics
How to displays statistics for week, month , year?
Thanks for your patience and answer
Phil
Using: pi-hole on pi 4 under Debian GNU/Linux 13 (trixie) and Docker version 29.4.0, build 9d7ad9f

Hello,
I didn't understand @jfb

I read documentation, I read some posts.
I'm using pi-hole with docker and didn't found:

  • how to have statistics by week, month, year ?
    currently only the current day:
  • how to display hostnames and not IP adresses ?
    current configuration:
    environment:
    # Set the appropriate timezone for your location (List of tz database time zones - Wikipedia), e.g:
    TZ: 'Europe/Paris'
    FTLCONF_webserver_api_password: 'xxxxxxxxxxxxxxxxxxxxxxxx'
    FTLCONF_dns_listeningMode: 'ALL'
    FTLCONF_dns_upstreams: '9.9.9.9'

  • how to have pihole as hostname and not (see screenshot)
    image

Thanks for your patience and help

This is unfortunately not(/no longer) possible. Long-term statistics were a feature in v5, but it was never ported over to v6.

There is always some confusion on the "Clients" tab. This is not the place to set names, even though it might look like it.

The names shown come from reverse DNS, this is most commonly achieved via:

  1. You can use the names already present in your router, if it exposes those via PTR records, for this go to: Settings > DNS > (enable Expert mode >) Conditional forwarding

  2. Use local DNS records. Enter your clients in Settings > Local DNS Records > Local DNS records

The hostname shown originates from the operating system, I'm not using docker myself, but this appears to be the container ID. I think this can be set with --hostname yourhostname when using docker run or hostname: yourhostname when using docker compose.

hostname in docker compose
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    hostname: yourhostname      <-- here
    ports:
      # DNS Ports
      - "53:53/tcp"
      - "53:53/udp"

Quoting because I'm curious why the functionality wasn't ported to v6? My intuition is tied between system performance and feature popularity (aka how many folks actually used it!)

While I'm a little bummed out that I can't look at my data anymore :frowning: , I will mention it was interesting to look at the historical graphs and uncover trends, humor, etc.

What are you looking for exactly?

If you are looking for historical query log data, then you can find it in Query Log page.

You just need to select the date and mark the checkbox to include data from the database, then click on "Refresh" button:

If you are looking for a graphic showing past data, then darkexplosiveqwx already answered. There is already a Feature Request to bring back the old Long-Term Data > Graphic page.

The dashboard will always show the last 24h.

Small correction :

Reverse DNS a.k.a. PTR Records are something completely different than the A/AAAA/CNAME Records that can be added via the Pi-Hole webGUI :wink:

DNS Record : hostname.domain.tld
PTR Record : Can also be hostname.domain.tld but very often is the IP Address Reversed and the domain.tld added after it : 1.1.168.192.domain.tld

Another option is a completely randomized PTR Record : gjlfkdjgfdk54343.domain.tld
Sometimes ISPs do this :slight_smile:

Hello Mr. smartass, I can do that too, don't worry :wink:

No, the A/AAAA records created in Pi-hole also create PTR records.

If you enter device.example.com -- 192.168.0.10 in "Local DNS records" two records are created:

device.example.com. 	0	IN	A	192.168.0.10

and

10.0.168.192.in-addr.arpa.	0	IN	PTR	device.example.com.

or for IPv6: ip6-device.example.com. -- fde6::6 results in these two records:

ip6-device.example.com.	0	IN	AAAA	fde6::6

and

6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.e.d.f.ip6.arpa. 0	IN	PTR	ip6-device.example.com.

PTR records are structured the following:
for IPv4 the order of octets is reversed and suffixed with .in-addr.arpa., take the example 10.0.168.192.in-addr.arpa..

for IPv6, the address is fully expanded and the order of nybbles (one hexadecimal character) is reversed and suffixed with .ip6.arpa., again take the IPv6 example from earlier.

Yes, ISPs sometimes assign random reverse names for their public IP ranges (I have observed this most commonly with IPv6)

Hello @darkexplosiveqwx
A huge thanks for the time you took to reply and for all the accurate answers. I really appreciate.

  • Statistics: OK, too bad
  • display hostnames and not IP adresses: Ok thanks for the tips,it works
    I used avahi-browse tool to find all machines on local network
  • pihole as hostname: It works now perfectly
    Thanks again
    Phil

Hello @rdwebdesign,
Thanks for your answer and many thanks for pi-hole, that's great
Yes it works but huge number of lines displayed :frowning:
What I am looking for:
-a click on a day, a week, a month, a year or a custom range displays something like:


best regards
Phil

I bet you can, but my point was just that the primary goal of the Pi-Hole webGUI is to create regular DNS Records and not Reverse DNS Records :wink:

The fact that the Reverse DNS Records are created too is basically just a nice bonus IMHO :slight_smile: