Pihole stops working after sometimes

My debug token is z3otzcf1ps . I am using the official pihole docker image. But, after few times its stops working.
Here is also a docker log:

  [i] Number of gravity domains: 76471 (76471 unique domains),
  [i] Number of exact blacklisted domains: 0,
  [i] Number of regex blacklist filters: 0,
  [i] Number of exact whitelisted domains: 0,
  [i] Number of regex whitelist filters: 0,
  [i] Cleaning up stray matter...
  [✓] Cleaning up stray matter,
,
  [✗] DNS service is NOT listening,
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec],
  Pi-hole version is v5.3.1 (Latest: v5.3.1),
  AdminLTE version is v5.5 (Latest: v5.5),
  FTL version is v5.8 (Latest: v5.8),
[cont-init.d] 20-start.sh: exited 0.,
[cont-init.d] done.,
[services.d] starting services,
Starting lighttpd,
Starting pihole-FTL (no-daemon) as root,
Starting crond,
[services.d] done.,
Stopping pihole-FTL,
Starting pihole-FTL (no-daemon) as root,
Stopping cron,
Stopping lighttpd,
Stopping pihole-FTL,
[cont-finish.d] executing container finish scripts...,
[cont-finish.d] done.,
[s6-finish] waiting for services.,
[s6-finish] sending all processes the TERM signal.,
[s6-finish] sending all processes the KILL signal and exiting.,
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] 01-resolver-resolv: applying... ,
[fix-attrs.d] 01-resolver-resolv: exited 0.,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 20-start.sh: executing... ,
 ::: Starting docker specific checks & setup for docker pihole/pihole,
,
  [i] Installing configs from /etc/.pihole...,
  [i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!,
  [i] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf...
  [✓] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf,
Existing DNS servers detected in setupVars.conf. Leaving them alone,
::: Pre existing WEBPASSWORD found,
DNSMasq binding to default interface: eth0,
Added ENV to php:,
			"PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",,
			"ServerIP" => "192.168.88.5",,
			"VIRTUAL_HOST" => "192.168.88.5",,
Using IPv4 and IPv6,
::: setup_blocklists now setting default blocklists up: ,
::: TIP: Use a docker volume for /etc/pihole/adlists.list if you want to customize for first boot,
::: Blocklists (/etc/pihole/adlists.list) now set to:,
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts,
::: Testing pihole-FTL DNS: FTL started!,
::: Testing lighttpd config: Syntax OK,
::: All config checks passed, cleared for startup ...,
::: Enabling Query Logging,
  [i] Enabling logging...,

  [✓] Logging has been enabled!,
 ::: Docker start setup complete,
  [✗] DNS service is not running,
  [i] Time until retry: 120
  [i] Time until retry: 120
  [i] Time until retry: 119
  [i] Time until retry: 118
  [i] Time until retry: 117
  [i] Time until retry: 116
  [i] Time until retry: 115
  [i] Time until retry: 114
  [i] Time until retry: 113
  [i] Time until retry: 112
  [i] Time until retry: 111
  [i] Time until retry: 110
  [i] Time until retry: 109
  [i] Time until retry: 108
  [i] Time until retry: 107
  [i] Time until retry: 106
  [i] Time until retry: 105
  [i] Time until retry: 104
  [i] Time until retry: 103
  [i] Time until retry: 102
  [i] Time until retry: 101
  [i] Time until retry: 100
  [i] Time until retry: 99
  [i] Time until retry: 98
  [i] Time until retry: 97
  [i] Time until retry: 96
  [i] Time until retry: 95
  [i] Time until retry: 94
  [i] Time until retry: 93
  [i] Time until retry: 92
  [i] Time until retry: 91
  [i] Time until retry: 90
  [i] Time until retry: 89
  [i] Time until retry: 88
  [i] Time until retry: 87
  [i] Time until retry: 86
  [i] Time until retry: 85
  [i] Time until retry: 84
  [i] Time until retry: 83
  [i] Time until retry: 82
  [i] Time until retry: 81
  [i] Time until retry: 80
  [i] Time until retry: 79
  [i] Time until retry: 78
  [i] Time until retry: 77
  [i] Time until retry: 76
  [i] Time until retry: 75
  [i] Time until retry: 74
  [i] Time until retry: 73
  [i] Time until retry: 72
  [i] Time until retry: 71
  [i] Time until retry: 70
  [i] Time until retry: 69
  [i] Time until retry: 68
  [i] Time until retry: 67
  [i] Time until retry: 66
  [i] Time until retry: 65
  [i] Time until retry: 64
  [i] Time until retry: 63
  [i] Time until retry: 62
  [i] Time until retry: 61
  [i] Time until retry: 60
  [i] Time until retry: 59
  [✓] DNS resolution is now available,
,
  [i] Neutrino emissions detected...,

  [✓] Pulling blocklist source list into range,
,
  [i] Preparing new gravity database...
  [✓] Preparing new gravity database,
  [i] Using libz compression,
,
  [i] Target: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts,
  [i] Status: Pending...
  [✓] Status: Retrieval successful,
  [i] Analyzed 76471 domains,
  [i] List stayed unchanged,
,
  [i] Storing downloaded domains in new gravity database...
  [✓] Storing downloaded domains in new gravity database,
  [i] Building tree...
  [✓] Building tree,
  [i] Swapping databases...
  [✓] Swapping databases,
  [i] Number of gravity domains: 76471 (76471 unique domains),
  [i] Number of exact blacklisted domains: 0,
  [i] Number of regex blacklist filters: 0,
  [i] Number of exact whitelisted domains: 0,
  [i] Number of regex whitelist filters: 0,
  [i] Cleaning up stray matter...
  [✓] Cleaning up stray matter,
,
  [✗] DNS service is NOT listening,
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec],
  Pi-hole version is v5.3.1 (Latest: v5.3.1),
  AdminLTE version is v5.5 (Latest: v5.5),
  FTL version is v5.8 (Latest: v5.8),
[cont-init.d] 20-start.sh: exited 0.,
[cont-init.d] done.,
[services.d] starting services,
Starting lighttpd,
Starting pihole-FTL (no-daemon) as root,
Starting crond,
[services.d] done.,
'unknown': unknown terminal type.,
/opt/pihole/piholeDebug.sh: line 1386: read: read error: 0: Invalid argument,
'unknown': unknown terminal type.,

After adding regular dns in the router restores the internet. Found out that in case of container restarts pihole needs an another dns server to update ftl. It wont start until I add an another DNS in the router. Usually pihole is the only DNS in the router.

Should be fixed already

Try re-update the image.

Do I need to add this in yml " PIHOLE_DNS_: '127.0.0.1' " , I mean do I need to have that line in the yml? I prefer to leave it blank, then configure it from the webui.

Does it work when you have it in the yaml? Does it work when it's not in the yaml? Does it do what you'd like it to do?

Report back if it doesn't.

Same issue, stopped working after few hours. doesn't matter if I use 127.0.0.1 or not. Query logs shows something like this:

Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.13
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.13
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.13
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] live.bongobd.com from 192.168.88.13
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] d27xxe7juh1us6.cloudfront.net from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED
Apr 22 04:41:28 dnsmasq[19303]: query[A] d27xxe7juh1us6.cloudfront.net from 192.168.88.1
Apr 22 04:41:28 dnsmasq[19303]: config error is REFUSED

And here is the .yml file,freshly installed few hours back. with newly created volumes:

version: "3"

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    networks:
      macvlan_network:
        ipv4_address: 192.168.88.5
    restart: unless-stopped
    environment:
      ServerIP: '192.168.88.5'
      TZ: 'Asia/Dhaka'
      WEBPASSWORD: 'PASS'
      TEMPERATUREUNIT: 'C'
      IPv6: 'false'
    volumes:
      - etc-pihole:/etc/pihole
      - etc-dnsmasq.d:/etc/dnsmasq.d
    cap_add:
      - NET_ADMIN

volumes:
  etc-pihole:
    external: true
  etc-dnsmasq.d:
    external: true
networks:
  macvlan_network:
    external:
      name: macvlan_network

Only thing I found in docker log is
i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!

And here is the permission from my docker host:

**pi@raspberrypi** : **/var/lib/docker/volumes $** sudo ls -l etc-dnsmasq.d

total 4

drwxr-xr-x 2 root root 4096 Apr 22 05:28 _data

**pi@raspberrypi** : **/var/lib/docker/volumes $** sudo ls -l etc-pihole

total 4

drwxrwxr-x 3 999 spi 4096 Apr 22 05:29 _data