Local Dns not matching up

I try to stick with pihole.toml as much as i can. I am use to an immediate change once i save the file. The issue is that when i update/edit/add localdns to pihole.toml. It does not update pihole. I have to go into the web gui and do it manually. Even with a container reboot the localdns ip was stale that was in the system and did not update when i used the pihole.toml file. I have a regex rsync situation going on to sync my piholes but is this a glitch or did you guys switch to the pihole.db or something?

1 Like

You should post your Container configuration IMHO if that's the case :wink:

So in case of Docker the .yaml file and all that stuff...

1 Like

I can't reproduce your issue - editing pihole.toml is picked up immediately and correctly carried over to /etc/pihole/hosts/custom.list.
This registers in pihole.log as follows:

2025-02-11 09:26:58.046 inotify: /etc/pihole/hosts/custom.list new or modified
2025-02-11 09:26:58.046 inotify: flushed 4 names read from /etc/pihole/hosts/custom.list
2025-02-11 09:26:58.047 read /etc/pihole/hosts/custom.list - 5 names

Do you see similar entries?

1 Like

i took a teleport backup from pihole1 and uploaded it to pihole2 so it would sync groups/hosts/ect. Now they both have different (virtual host) domain names. But since its in the docker-compose explicitly. I would think either 1 it cant be modified or 2 if i restart the container it would take the change. Neither have happened. pihole.toml in no way for any option is being pulled in when the container is running and it is modified.

[webserver]
  # On which domain is the web interface served?
  #
  # Possible values are:
  #     <valid domain>
  domain = "pibak.domain.dev" ### CHANGED, default = "pi.hole"
  pihole:
    build:
      context: https://github.com/pi-hole/docker-pi-hole.git#development:/src
      no_cache: true
      network: host
    image: build_pihole6
    container_name: pihole
    hostname: pihole
    networks:
      dnet:
        ipv4_address: '172.22.0.153'
    ports:
      - "53:53/tcp"
      - "53:53/udp"
    environment:
      TZ: 'America/New_York'
      FTLCONF_dns_dnssec: 'False'
      PIHOLE_UID: 1000
      PIHOLE_GID: 1000
      DNSMASQ_USER: pihole
      FTLCONF_dns_upstreams: 'cloudflared#5054'
      FTLCONF_dns_listeningMode: all
      FTLCONF_webserver_api_temp_unit: 'F'
      FTLCONF_webserver_tls_rev_proxy: true
      FTLCONF_dns_reply_host_IPv4: 192.168.9.52
      VIRTUAL_HOST: "pibak.domain.dev"
      TAIL_FTL_LOG: 1
      SKIPGRAVITYONBOOT: 1
      IPv6: false
    volumes:
      - '$DOCKER_DIR/pihole:/etc/pihole'
      - '$DOCKER_DIR/pihole/dnsmasqd:/etc/dnsmasq.d'
      - '$DOCKER_DIR/pihole/log:/var/log/pihole'
    restart: unless-stopped
    labels:
      - "diun.enable=true"
      - "traefik.enable=true"
      - "traefik.http.routers.pihole.rule=Host(`pibak.domain.dev`)"
      - "traefik.http.routers.pihole.tls=true"
      - "traefik.http.routers.pihole.entrypoints=websecure"
      - "traefik.http.routers.pihole.tls.options=modern@file"
      - "traefik.http.routers.pihole.middlewares=default-security-headers@file,gzip@file,https-redirect@file"
      - "traefik.http.services.pihole.loadbalancer.server.port=443"
      - "traefik.http.services.pihole.loadbalancer.server.scheme=https"
Core
    Version is abb94ca (Latest: null)
    Branch is development
    Hash is abb94caf (Latest: abb94caf)
Web
    Version is 65ad66d (Latest: null)
    Branch is development
    Hash is 65ad66d6 (Latest: 65ad66d6)
FTL
    Version is vDev-d70af72 (Latest: null)
    Branch is development
    Hash is d70af726 (Latest: d70af726)
1 Like

There is no VIRTUAL_HOST variable in v6.

If you just want to change pi.hole, you can use this option:

1 Like

Great thanks.

FTLCONF_webserver_domain worked. But still can edit pihole.toml to take affect.

image

❯ dkl pihole
  [i] Setting up user & group for the pihole user
  [i] Changing ID for user: pihole (100 => 1000)
  [i] Changing ID for group: pihole (101 => 1000)

  [i] Starting FTL configuration
  [i] Password already set in config file
  [i] Starting crond for scheduled scripts. Randomizing times for gravity and update checker

  [i] Ensuring logrotate script exists in /etc/pihole

  [i] Gravity migration checks
  [i] Existing gravity database found

  [i] pihole-FTL pre-start checks
  [i] Setting capabilities on pihole-FTL where possible
  [i] Applying the following caps to pihole-FTL:
        * CAP_CHOWN
        * CAP_NET_BIND_SERVICE
        * CAP_NET_RAW

  [i] Starting pihole-FTL (no-daemon) as pihole

Core
    Version is abb94ca (Latest: null)
    Branch is development
    Hash is abb94caf (Latest: abb94caf)
Web
    Version is 65ad66d (Latest: null)
    Branch is development
    Hash is 65ad66d6 (Latest: 65ad66d6)
FTL
    Version is vDev-d70af72 (Latest: null)
    Branch is development
    Hash is d70af726 (Latest: 32d23457)

2025-02-12 15:01:25.972 EST [63M] INFO: ########## FTL started on pihole! ##########
2025-02-12 15:01:25.972 EST [63M] INFO: FTL branch: development
2025-02-12 15:01:25.972 EST [63M] INFO: FTL version: vDev-d70af72
2025-02-12 15:01:25.972 EST [63M] INFO: FTL commit: d70af726
2025-02-12 15:01:25.972 EST [63M] INFO: FTL date: 2025-02-11 21:04:03 +0100
2025-02-12 15:01:25.972 EST [63M] INFO: FTL user: pihole
2025-02-12 15:01:25.972 EST [63M] INFO: Compiled for linux/amd64 (compiled on CI) using cc (Alpine 14.2.0) 14.2.0
2025-02-12 15:01:25.975 EST [63M] INFO: 7 FTLCONF environment variables found (6 used, 0 invalid, 1 ignored)
2025-02-12 15:01:25.975 EST [63M] INFO:    [✓] FTLCONF_dns_listeningMode is used
2025-02-12 15:01:25.975 EST [63M] INFO:    [✓] FTLCONF_dns_reply_host_IPv4 is used
2025-02-12 15:01:25.975 EST [63M] WARNING: [?] FTLCONF_webserver_tls_rev_proxy is unknown, did you mean any of these?
2025-02-12 15:01:25.975 EST [63M] WARNING:     - FTLCONF_webserver_tls_cert
2025-02-12 15:01:25.975 EST [63M] INFO:    [✓] FTLCONF_dns_upstreams is used
2025-02-12 15:01:25.975 EST [63M] INFO:    [✓] FTLCONF_webserver_api_temp_unit is used
2025-02-12 15:01:25.975 EST [63M] INFO:    [✓] FTLCONF_dns_dnssec is used
2025-02-12 15:01:25.975 EST [63M] INFO:    [✓] FTLCONF_webserver_domain is used
2025-02-12 15:01:25.976 EST [63M] INFO: Wrote config file:
2025-02-12 15:01:25.976 EST [63M] INFO:  - 152 total entries
2025-02-12 15:01:25.976 EST [63M] INFO:  - 131 entries are default
2025-02-12 15:01:25.976 EST [63M] INFO:  - 21 entries are modified
2025-02-12 15:01:25.976 EST [63M] INFO:  - 5 entries are forced through environment
2025-02-12 15:01:25.978 EST [63M] INFO: Parsed config file /etc/pihole/pihole.toml successfully
2025-02-12 15:01:25.978 EST [63M] INFO: PID file does not exist or not readable
2025-02-12 15:01:25.978 EST [63M] INFO: No other running FTL process found.
2025-02-12 15:01:25.978 EST [63M] WARNING: Insufficient permissions to set process priority to -10 (CAP_SYS_NICE required), process priority remains at 0
2025-02-12 15:01:25.980 EST [63M] INFO: PID of FTL process: 63
2025-02-12 15:01:25.982 EST [63M] INFO: listening on 0.0.0.0 port 53
2025-02-12 15:01:25.982 EST [63M] INFO: listening on :: port 53
2025-02-12 15:01:25.983 EST [63M] INFO: PID of FTL process: 63
2025-02-12 15:01:25.985 EST [63M] INFO: Database version is 21
2025-02-12 15:01:25.985 EST [63M] INFO: Database successfully initialized
2025-02-12 15:01:26.973 EST [63M] INFO: Imported 81771 queries from the on-disk database (it has 12722718 rows)
2025-02-12 15:01:26.973 EST [63M] INFO: Parsing queries in database
2025-02-12 15:01:26.991 EST [63M] INFO:   10000 queries parsed...
2025-02-12 15:01:27.008 EST [63M] INFO:   20000 queries parsed...
2025-02-12 15:01:27.024 EST [63M] INFO:   30000 queries parsed...
2025-02-12 15:01:27.043 EST [63M] INFO:   40000 queries parsed...
2025-02-12 15:01:27.070 EST [63M] INFO:   50000 queries parsed...
2025-02-12 15:01:27.095 EST [63M] INFO:   60000 queries parsed...
2025-02-12 15:01:27.116 EST [63M] INFO:   70000 queries parsed...
2025-02-12 15:01:27.133 EST [63M] INFO:   80000 queries parsed...
2025-02-12 15:01:27.136 EST [63M] INFO: Imported 81741 queries from the long-term database
2025-02-12 15:01:27.136 EST [63M] INFO:  -> Total DNS queries: 81741
2025-02-12 15:01:27.136 EST [63M] INFO:  -> Cached DNS queries: 71385
2025-02-12 15:01:27.136 EST [63M] INFO:  -> Forwarded DNS queries: 3497
2025-02-12 15:01:27.136 EST [63M] INFO:  -> Blocked DNS queries: 5820
2025-02-12 15:01:27.137 EST [63M] INFO:  -> Unknown DNS queries: 42
2025-02-12 15:01:27.137 EST [63M] INFO:  -> Unique domains: 1536
2025-02-12 15:01:27.137 EST [63M] INFO:  -> Unique clients: 4
2025-02-12 15:01:27.137 EST [63M] INFO:  -> DNS cache records: 569
2025-02-12 15:01:27.137 EST [63M] INFO:  -> Known forward destinations: 1
2025-02-12 15:01:27.241 EST [63M] WARNING: Insufficient permissions to set system time (CAP_SYS_TIME required), NTP client not available
2025-02-12 15:01:27.241 EST [63/T166] INFO: NTP server listening on 0.0.0.0:123 (IPv4)
2025-02-12 15:01:27.241 EST [63/T167] INFO: NTP server listening on :::123 (IPv6)
2025-02-12 15:01:27.241 EST [63M] INFO: FTL is running as user pihole (UID 1000)
2025-02-12 15:01:27.241 EST [63M] INFO: Reading certificate from /etc/pihole/tls.pem ...
2025-02-12 15:01:27.242 EST [63M] INFO: Using SSL/TLS certificate file /etc/pihole/tls.pem
2025-02-12 15:01:27.242 EST [63M] INFO: Web server ports:
2025-02-12 15:01:27.242 EST [63M] INFO:   - 80 (HTTP, IPv4)
2025-02-12 15:01:27.242 EST [63M] INFO:   - 443 (HTTPS, IPv4)
2025-02-12 15:01:27.242 EST [63M] INFO: Restored 0 API sessions from the database
2025-02-12 15:01:27.244 EST [63M] INFO: Blocking status is enabled
2025-02-12 15:01:27.353 EST [63/T168] INFO: Compiled 10 allow and 18 deny regex for 4 clients in 9.7 msec

Yes.
Try FTLCONF_webserver_domain.

Note:
Every FTL setting can be set using the format:
FTLCONF_ + the setting (replacing the . with a _)

Im making changes to pihole.toml while tail -f pihole.log and not seeing a inotify or read notification. Is their a setting or something that turns this off or on?

Edit: to my surprise this issue is only on pihole(2). I did see this in the log on pihole(1). The compose settings are identical I literally made a vm backup on my second proxmox node so it shouldn't vary. besides the domain name.

The messages are also shown in FLT.log.

This was on pihole(1)

╰─❯ tail -f pihole.log | grep "inotify\|read" -i
Feb 12 15:32:22 dnsmasq[51]: inotify: /etc/pihole/hosts/custom.list new or modified
Feb 12 15:32:22 dnsmasq[51]: inotify: flushed 170 names read from /etc/pihole/hosts/custom.list
Feb 12 15:32:22 dnsmasq[51]: read /etc/pihole/hosts/custom.list - 171 names

Im blowing away pihole(2) and making a fresh copy with a teleport import and see what happens

How did you create the volume directories on that machine, particularly the one for /etc/pihole?

just set it up in docker compose and it made it on its own... the dir structure is listed above... It works now after i blew it up and reimported my primary piholes teleport... :person_shrugging: thanks for the help though. We'll call it a glitch in the matrix i guess.

If restoring the VM would have included creating the mount directories, perhaps that may have muddled permissions?

The saftest way to create them would indeed be to "just set it up in docker compose and it made it on its own".

But as it's working for you now, I'll guess we'll never know. :wink: