Casaos - Pihole don't resolve local ip names

Hi all!
i have followed Bigbearyouyube tutorial for install Pihole docker on my CasaOs without any issue.
Pihole like dns on my lan works and block ads as normal.
My fritzbox is the dhcp server and i set the pihole ip ad dns relased so every device use pihole as dns.
The problem starts when from my laptop i try to ping the casaos server with his name, lnxsrv.fritz.com
Instead resolving it like 192.168.188.100, that is the correct server ip, it’s resolved like this 54.39.222.96.
The nslookup shows:

Server: 192.168.188.100
Address: 192.168.188.100#53
Non-authoritative answer:
Name: lnxsrv.fritz.box
Address: 54.39.222.96

From any device configured with pihole ip as dns i can’t reach the right local ip address, and another strange thing, every device i try to do nslookup shows every time always 54.39.222.96 as ip.

If i rollback the dns from dhcp server setting to my router ip, all starts to running again without issues (but obviously without blocking any ads) and every nslookup shows the right ip address of my devices.

If i set on dhcp my pihole dns server, nslookup shows every time:
Non-authoritative answer:
Name: devicename.fritz.box
Address: 54.39.222.96

Where i’m wrong?

The issue arises with how Pi-hole and its upstream DNS server handle local domain names (like lnxsrv.fritz.box ). Since these local domain names are not part of the global DNS system, the upstream DNS server cannot resolve them to their local IP addresses. As a result, the request might be mistakenly resolved to an external IP address if the upstream DNS server attempts to “guess” or if there’s a wildcard DNS record in place for unresolved queries, which seems to be happening in your case with the IP address 54.39.222.96 being returned.

To solve this issue, you can manually add local DNS records in Pi-hole for your local devices. This way, when a DNS request for lnxsrv.fritz.box reaches Pi-hole, it can directly respond with the correct local IP address without forwarding the request to its upstream DNS server. Here’s how you can do it:

  • Access the Pi-hole admin interface.
  • Go to the “Local DNS” menu, then to “DNS Records.”
  • Add a new DNS record for each of your local devices, specifying the hostname (e.g., lnxsrv.fritz.box) and its corresponding local IP address (e.g., 192.168.188.100).
  • Save the changes and ensure the DNS cache is cleared on your devices, or restart them to ensure they query for the latest DNS information.