Pi-hole Docker on Ubuntu 24.04 with Fritz!Box: Sporadic Ad Blocking Issues

Goal:
I want to run Pi-hole locally on my Ubuntu 24.04 machine (not for the whole network), so that only my own computer uses it for ad-blocking and DNS filtering. I'm trying to set up Pi-hole using Docker on Ubuntu 24.04, following the official docker-compose instructions from the Pi-hole GitHub page. My network uses a Fritz!Box router.

Browser: Chromium

Here’s what I’ve tried so far:

  • Created a docker-compose.yaml as per the official documentation.
  • Ran sudo docker compose up -d to start the container.
  • Modified my netplan config to include use-dns: false and set the nameserver to 127.0.0.1, with DNSStubListener=no in /etc/systemd/resolved.conf, then ran sudo netplan apply.
  • Restarted systemd-resolved after changes.
  • Despite these steps, ads are sometimes still visible and sometimes not and most DNS requests seem to bypass Pi-hole, though some requests do appear in the Pi-hole query log.

Additional Info:

  • Docker is using the default bridge network.
  • I set Pi-hole’s interface listening behavior to "Listen on all interfaces, permit all origins".
  • I tried the recommended symlink for /etc/resolv.conf to /run/systemd/resolve/resolv.conf and restarted systemd-resolved 6.

Questions:

  • What am I missing to get Pi-hole to block ads for my device?
  • Are there specific Fritz!Box or Ubuntu 24.04 settings I should check?

Any advice or troubleshooting steps would be greatly appreciated!

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

docker exec -it <pihole-container-name-or-id> pihole -d

where you substitute <pihole-container-name-or-id> as required.

i get the following error:

[?] Would you like to upload the log? [y/N] y
* Using curl for transmission.
* curl failed, contact Pi-hole support for assistance.
* Error message: curl: (6) Could not resolve host: tricorder.pi-hole.net

also i cant update the gravity lists:

[✗] DNS resolution is currently unavailable
[i] Waiting until DNS resolution is available...

it worked a few hours ago but now it doesnt

did a sudo docker compose down
changed the netplan configuration back
sudo netplan apply

then started the docker again with sudo docker compose up -d

changed the netplan configuration back again to use 127.0.0.1 nameserver and it works now again (Maybe it has something to do with reboots?)

anyways here is the debug token:

https://tricorder.pi-hole.net/Wij6Yxrr/

i can confirm that it doenst work after a reboot i have to do a docker compose down and then an docker compose up -d to make it work again

That's probably not the best choice for using an isolated Pi-hole on a desktop OS.
Docker is both late in the list of processes to start and takes some time to start up.

If you defer DNS duties to dockered Pi-hole, you may delay or perhaps even prevent processes from starting successfully, if they'd have to rely on DNS.

In addition, your machine's OS may still pick up a DNS server IPv6 address as advertised by your router, and if it's aware of that, it may just prefer to use that, as it has learned that its local IPv4 was not responding to DNS requests at all during startup, probably marking it as inoperational.

You should make sure that your router does not advertise an IPv6 DNS server address.
You may also want to consider a bare metal installation of Pi-hole.

i have ipv6 disabled on my router and locally on my network adatper aswell

It's still weird that sometimes, when I open a page, I suddenly see google ads that should have been blocked. The only thing that helps is restarting the Docker container before closing the browser. I don't understand why it stops working so sporadically.