Do not see DHCP devices in logs

Hi,

I can only see other docker services in logged, like service.pihole.
Devices from DHCP are not recognized (they all fall to 192.168.4.1, docker's internal network gateway).

Is there a way to fix this? I think it was working before last update?

Thank you.

Please follow at least the template

Please follow the below template, it will help us to help you!

If you are Experiencing issues with a Pi-hole install that has non-standard elements (e.g you are using nginx instead of lighttpd, or there is some other aspect of your install that is customised) - please use the Community Help category.

Expected Behaviour:

[Replace this text with what you think should be happening. Please include as much detail as possible including, but not limited to:
-operating system
-hardware]

Actual Behaviour:

[replace this text with what is actually happening]

Debug Token:

[Replace this text with the debug token provided from running pihole -d (or running the debug script through the web interface]

1 Like

Expected Behaviour:

The expected behaviour is having the devices using the DHCP service properly recognized and logged in the query log.

Actual Behaviour:

Acutally, only other docker services get properly recognized (service.pihole) and logged, while all of the DHCP devices get logged as the gateway IP of the intenal docker network (192.168.4.1)

Debug Token:

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

Please, also post your compose file or docker run command used to start the container.

services:
  pihole:
    container_name: pihole
    domainname: docker
    hostname: pihole
    image: pihole/pihole:latest
    pull_policy: always
    restart: unless-stopped
    ports:
      - "53:53/tcp"
      - "53:53/udp"
    cap_add:
      - NET_ADMIN
    dns:
      - 127.0.0.1
    environment:
      - ServerIP=${SERVER_IP}
      - PROXY_LOCATION="pihole"
      - VIRTUAL_HOST=pihole.${DOMAINNAME_1}
      - VIRTUAL_PORT=80
      - TZ=${TZ}
      - WEBPASSWORD=piholeadmin
      - DNS1=192.168.4.101#5054
      - IPv6=false
      - DNS2=""
      - DNSMASQ_LISTENING=all
    volumes:
      - '$CONFIGDIR/pihole/pihole/:/etc/pihole/'
      - '$CONFIGDIR/pihole/dnsmasq.d/:/etc/dnsmasq.d/'
    depends_on:
      - dhcphelper
    networks:
      traefik:
        ipv4_address: '192.168.3.100'
      pihole:
        ipv4_address: '192.168.4.100'
    labels:
      - "org.label-schema.group=monitoring"
      - "traefik.enable=true"
      # HTTP Routers
      - "traefik.http.routers.pihole-rtr.entrypoints=websecure"
      - "traefik.http.routers.pihole-rtr.rule=Host(`pihole.$DOMAINNAME_1`)" # HostRegexp:pihole.${DOMAINNAME_1},{catchall:.*}" # Host(`pihole.$DOMAINNAME_1`)"
      # Middlewares
      - "traefik.http.routers.pihole-rtr.middlewares=middlewares-chain-no-auth@file"
      # HTTP Services
      - "traefik.http.routers.pihole-rtr.service=pihole-svc"
      - "traefik.http.services.pihole-svc.loadbalancer.server.port=80"

You have networks declared inside your services, but you need to declare your networks in the yml file like this:

services:
  pihole:
    ...
    networks:
    ...

networks:
  ...

Sorry, I only posted the pihole service yaml, here's the complete docker-compose, containing the networks:

version: "3.9"

# NETWORKS
networks:
  traefik:
    external: true
  pihole:
    external: true
  monitoring:
    external: true
#  dnet:
#    external: true

# SECRETS
secrets:
  cf_dns_api_token:
    file: $SECRETSDIR/cf_dns_api_token

# SERVICES

include:
# NETWORK
  # Traefik 2 - Reverse Proxy
  - compose/network/traefik.yaml

  #Cloudflared DNS DoH
  - compose/network/cloudflared.yaml

  #Pihole DNS DHCP server
  - compose/network/pihole.yaml
[...]

Is there anything I can do to fix/debug it?