HUB
Sign inSign up

hunterelele/elele-dns

By hunterelele

•Updated 3 months ago

Self-hosted DNS analytics for AdGuard Home or Pi-hole. 90 days of history, not just today.

Image
Networking
API management
Web analytics
0

518

hunterelele/elele-dns repository overview

⁠elele. DNS

A self-hosted analytics front end for AdGuard Home or Pi-hole v6+.

Your resolver already blocks the ads. It just cannot tell you much about what it did: its query log is a circular buffer that overwrites itself within the day, and its dashboard counts things rather than explaining them. This reads that log continuously into a store of its own, keeps ninety days of it, and turns the result into the thing the log was always describing.

Live demo: dns.elele.dev⁠ (invented data, no real household's history is published there)

⁠Read this before you deploy it

There is no authentication. No login, no session, no access control on any route. Anyone who can reach the address can read every DNS query the network has made (device names, IP addresses, ninety days of browsing) and can change what the resolver does through /control.

That is deliberate for a tool that runs on a trusted private network beside the resolver it reads, where the network is the security boundary. It is not safe on a public address. Bind it to your LAN, do not port-forward it, and do not put it behind a tunnel or an internet-facing proxy without real authentication in front of it first.

⁠Quick start

services:
  elele-dns:
    image: hunterelele/elele-dns:latest
    container_name: elele-dns
    restart: unless-stopped
    env_file: .env
    ports:
      # The image listens on 3001. The left-hand side is the port you visit.
      - "3000:3001"
    volumes:
      - ./data:/data
    # No healthcheck here on purpose. The image already declares one against
    # /api/health using node's own fetch. Overriding it with a shell tool is how
    # you end up permanently unhealthy: this is a slim image and it ships
    # neither wget nor curl.
# .env, chmod 600 it: it holds your resolver password
DNS_PROVIDER=adguard
ADGUARD_URL=http://192.168.1.10:3000
ADGUARD_USERNAME=admin
ADGUARD_PASSWORD=your-adguard-password
DATABASE_PATH=/data/queries.db
RETENTION_DAYS=90
PUBLIC_URL=http://192.168.1.10:3000

The container runs as uid 1001 rather than root. The image gives /data to that user when it is built, but a bind mount covers that over with a directory the host has just created as root, and SQLite cannot create a database in a directory it cannot write to. So make it once, up front:

mkdir -p data && sudo chown -R 1001:1001 data

Then docker compose up -d, and visit port 3000 on the host.

There is also a one-line installer that sets up AdGuard Home too, if you do not already run one:

curl -fsSL https://dns.elele.dev/install.sh | sudo bash

Piping a URL into a root shell deserves a second's hesitation every time, so if you would rather read it first, download it and run it yourself. Same result:

curl -fsSL https://dns.elele.dev/install.sh -o install.sh
less install.sh                 # read it
chmod +x install.sh             # it arrives non-executable
sudo ./install.sh

That chmod is not optional: curl -o writes a plain file with no execute bit, so ./install.sh answers Permission denied until you set it. Add --dry-run to watch it decide without letting it act, and --dashboard-only if you already run a resolver and do not want it installing AdGuard Home.

The file is version-controlled at public/install.sh and mirrored to every place that serves it, so the copy you read is the copy that runs.

⁠Updating

docker compose pull && docker compose up -d

:latest is rebuilt from master on every push. Pin :0.2.0 instead if you would rather choose when that happens.

⁠Configuration

Pick a resolver with DNS_PROVIDER. Only the matching block matters; the other is ignored.

VariableDefault
DNS_PROVIDERadguardadguard or pihole
ADGUARD_URLe.g. http://192.168.1.10:3000
ADGUARD_USERNAME
ADGUARD_PASSWORD
PIHOLE_URLe.g. http://192.168.1.10
PIHOLE_PASSWORDthe app password, not the web password
DATABASE_PATH/data/queries.dbkeep it on the mounted volume
RETENTION_DAYS90detail rows; hourly rollups never expire
INGEST_ENABLEDtrue
INGEST_POLL_INTERVAL_MS5000
INGEST_PAGE_SIZE500
PUBLIC_URLneeded so notification links open this dashboard
NOTIFY_ENABLEDtrue
NOTIFY_HISTORY_DAYS30

The analytics are identical for either resolver, because every screen reads this project's own store rather than passing anything through. The two differ only where the resolvers themselves do: the control section, and the destinations map, which needs answer addresses that Pi-hole's API does not report.

⁠Details

  • Ports: the container listens on 3001. Map whatever host port you like.
  • Volume: /data holds one SQLite file. It is the only thing here worth backing up. A bind mount is suggested so you can find it without knowing Docker's storage layout.
  • Platforms: linux/arm64 and linux/amd64, so a Raspberry Pi, a NAS, an Unraid box or any x86 host all pull a native image. A Pi 5 is what it was designed against and tuned for, not what it requires: the only real requirement is that it can reach the resolver over your network.
  • Storage: SQLite in WAL mode, tuned for an SD card. Prefer SSD or NVMe if the Pi has one, since sustained ingest writes wear SD cards fast.

Pin a version rather than :latest if you want to control when updates land: image: hunterelele/elele-dns:0.2.0.

⁠Documentation

The full walkthrough, including Pi-hole setup, updating, backups and troubleshooting, is in the wiki on the demo site: dns.elele.dev/wiki⁠


Not affiliated with AdGuard Software Limited. AdGuard Home is their trademark, used here to identify the software this interoperates with.

Tag summary
Recent tags
Content type
Image
Digest
sha256:a1fb9952c…
Size
142.4 MB
Last updated
3 months ago
docker pull hunterelele/elele-dns:latest