Failing to resolve IP of service (container) running alongside pihole

My PiHole is running as a docker container along side my other service nginx on my local raspberry pi. The rpi address is 192.168.1.13.

I am using pihole as a DNS I am want all devices on my network to resolve nginx.home to 192.168.1.13.

I have created a DNS record for nginx.home -> 192.168.1.13

The router is using pihole as a DNS and all ads are getting blocked.
Pihole is acting as my DHCP server.

When I query nginx.home from a device on my network I get

➜  ~ dig nginx.home

; <<>> DiG 9.10.6 <<>> nginx.home
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 6880
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;nginx.home.			IN	A

;; Query time: 52 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Wed Apr 24 15:52:34 BST 2024
;; MSG SIZE  rcvd: 38

No answer.

I then created another DNS entry hello.home -> 1.2.3.4

Which gave me;

➜  ~ dig hello.home

; <<>> DiG 9.10.6 <<>> hello.home
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31357
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;hello.home.			IN	A

;; ANSWER SECTION:
hello.home.		0	IN	A	1.2.3.5

;; Query time: 88 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Wed Apr 24 15:53:59 BST 2024
;; MSG SIZE  rcvd: 55

This returned the "correct" answer.

From this I take that pihole does not like resolving IP addresses to the machine that itself is running on.

Has anybody else had this problem?

My entry in docker-compose looks like;

  pihole:
    container_name: pihole
    depends_on:
      - traefik
    image: pihole/pihole:2024.03.2
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
      - "8082:80/tcp"
    environment:
      TZ: 'America/Chicago'
      # WEBPASSWORD: 'set a secure password here or it will be random'
    # Volumes store your data between container upgrades
    volumes:
      - ../services/pihole/pihole:/etc/pihole
      - ../services/pihole/etc-dnsmasq.d:/etc/dnsmasq.d
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      - NET_ADMIN
    restart: always

Any help is 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:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

Good Morning. The debug token url is https://tricorder.pi-hole.net/QQRNDyVq/

What is the output of: dig nginx.home @192.168.1.13 ?

Above result suggests you have ommitted a space between home and @.

Please run the command exactly as provided by rdwebdesign.

Apologies.

; <<>> DiG 9.10.6 <<>> nginx.home @192.168.1.13
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55313
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;nginx.home.			IN	A

;; ANSWER SECTION:
nginx.home.		0	IN	A	192.168.1.13

;; Query time: 54 msec
;; SERVER: 192.168.1.13#53(192.168.1.13)
;; WHEN: Thu Apr 25 21:44:59 BST 2024
;; MSG SIZE  rcvd: 54

That look better. Althought curl gives me

curl -v https://nginx.home
* Could not resolve host: nginx.home
* Closing connection 0
curl: (6) Could not resolve host: nginx.home