domains not resolving locally with dns

I have setup pihole as a docker container in portainer on a server in my local network and it provides DNS and DHCP on my local network. DHCP is working perfectly. I tried setting up a test for the DNS by adding the entry blah.blah and the IP 192.168.0.2 (the IP of the docker host where Pihole is running) in the DNS records of the pihole UI but when I try to access pihole from another host in the network using blah.blah/admin/index.php it does not resolve and instead just goes to a google search.

If I enter the ip address directly in the browser 192.168..0.2/admin/index.php I get to the pihole login screen and it works as expected. I tried nslookup blah.blah on this host and it returns what I believe it should:

nslookup blah.blah

Server: 192.168.0.2

Address: 192.168.0.2#53

Name: blah.blah

Address: 192.168.0.2

Any ideas why DNS seems to be working but I can't actually reach the service with the domain name?

Did you try nslookup from your client machine?

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

Also, 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 (Pi-hole v5 only): Tools > Generate Debug Log

Thanks for the reply. The debug token is: https://tricorder.pi-hole.net/ys6rtnnq/

My compose file is:

# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    #ports:
    #  - "53:53/tcp"
    #  - "53:53/udp"
    #  - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
    #  - "80:80/tcp"
    #  - "7300:80/tcp" # Web UI HTTP
    network_mode: host
    environment:
      TZ: 'Europe/Prague'
      WEBPASSWORD: 'xxxxxx'
    # Volumes store your data between container upgrades
    volumes:
      - '/home/tony/Docker/pihole/etc-pihole:/etc/pihole'
      - '/home/tony/Docker/pihole/etc-dnsmasq.d:/etc/dnsmasq.d'
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      - NET_ADMIN
    restart: unless-stopped

Sorry not sure what you mean by 'client' machine in this context. The nslookup output I posted was from a laptop on my home lan. If I run it from the docker host it's as follows:

tony@media-server:~/Docker/pihole/etc-dnsmasq.d$ nslookup blah.blah
Server:		127.0.0.53
Address:	127.0.0.53#53

Name:	blah.blah
Address: 192.168.0.2

Just realised from the debug log that CNAMES were set - deleted those and my duckdns.org domain has started resolving locally but not the blah.blah domain that points to the docker host. I suspect there is something specific about the config on the host that is broken.