No name resolution for PCs pointing to pi-hole docker on Synology NAS behind existing DNS/DHCP server

The issue I am facing:
No name resolution for PCs pointing to pi-hole docker on Synology NAS behind existing DNS/DHCP server.

Details about my system:
Synology D920+
DSM7
Synology docker
Docker Tag 2022.07.1
Pi-hole v5.11.4
FTL v5.16.1
Web Interface v5.13

My set-up:

[Internet]
     |
[Router (no DNS, no DHCP]
     |
------ [LAN 192.168.1.0/24]
|
|--[ics-dhcp / DNS] .8
|--[SynologyNAS] .126/.127
|  [pi-hole] .127 (upstream DNS .8)
|
|--[GoogleTV] (DNS .127)
|--[MyLinuxMintMachine] (DNS see problem description)
|
|--[heaps of other machines]

What I have changed since installing Pi-hole:

I added the existing DNS server .8 as custom 1 upstream DNS server)
Everything else as per default

Demonstrating the issue

When I nslookup any other local machine via name, I will get the machine's name, if connected to my local DNS server .8

# [2022-07-15 22:31] maxg@x570 ~ $ 
nslookup rpi32 192.168.1.8
Server:		192.168.1.8
Address:	192.168.1.8#53

Name:	rpi32.argylecourt.lan
Address: 192.168.1.8

# [2022-07-15 22:32] maxg@x570 ~ $ 
nslookup rpi32 192.168.1.127
Server:		192.168.1.127
Address:	192.168.1.127#53

Non-authoritative answer:
Name:	rpi32.argylecourt.lan
Address: 192.168.1.8

When I nslookup any other local machine via name, I will *not get the machine's name, if connected to the pi-hole DNS (.127)

# [2022-07-15 18:12] maxg@x570 ~ $ 
nslookup rpi32 192.168.1.127
Server:		192.168.1.127
Address:	192.168.1.127#53

** server can't find rpi32: NXDOMAIN

# [2022-07-15 22:27] maxg@x570 ~ $ 
nslookup rpi32 192.168.1.8
Server:		192.168.1.8
Address:	192.168.1.8#53

** server can't find rpi32: NXDOMAIN

I hoped that by pointing the pi-hole to the existing DNS server, it would get both IP and name for local machines.

When pointing to the pi-hole DNS I can no longer type: ssh rpi32, but have to use its IP instead.

Question

Any ideas what I need to change on the pi-hole for it to resolve names?
Any hits appreciated.

Your output shows resolution via Pi-hole to be working around 2022-07-15 22:32:

But it did't work earlier, around 2022-07-15 18:12:

What has changed in between?
What has changed since that you seem to suggest its currently again not working?

Also, 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

Thank you for your reply.

Well, the one that works is when my machine's DNS points to .8

If I point my machine's DNS to .127 (pi-hole) then I get then NXDOMAIN.

Which is the core problem: pointing my machine to .1257 (pi-hole) and I can no longer address machines by name.

I created the debug.log via the Tools menu.
The token is 6IfiLak8

Sorry, I may not understand your issue yet.

According to your nslookup results, that was the case at 2022-07-15 18:12.

But a good four hours hours later at 2022-07-15 22:32, your nslookup for rpi32 produced the correct answer from your Pi-hole at 192.168.1.127:

So according to those nslookups that you've provided, the most current lookup for rpi32 via your Pi-hole is working, isn't it?

No problem :slight_smile:

I have a network, DNS = .8, all is working perfectly. I can resolve names (from my machine .13).

I added pi-hole and it's DNS on .127.
Pi-hole is working perfectly.

However, when I want to resolve local machine names, it does not resolve when my machine's DNS points to .127, but does resolve names when I point my machine to .8

Just in case, my resolve.conf looks like this:

# [2022-07-17 07:30] maxg@x570 ~ $ 
cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
nameserver 127.0.0.53
options edns0 trust-ad
search argylecourt.lan

... which is normal, considering Linux machines have DNS caches.

I am happy to provide more specific answers if being asked. :slight_smile:


I am not sure, whether pi-hole or rather dnsmasq needs a zone transfer of sort, to provide the local name resolution. Maybe my link to pi-hole is incorrect and I should really be pointing to a dnsmasq issue. At least this what I suspect... though without being educated enough to provide evidence for it.


The first lot shows my .13 pointing to .8; the next pointing to .127

# [2022-07-17 09:10] maxg@x570 ~ $ 
resolvectl status enp3s0 
Link 2 (enp3s0)
      Current Scopes: DNS            
DefaultRoute setting: yes            
       LLMNR setting: yes            
MulticastDNS setting: no             
  DNSOverTLS setting: no             
      DNSSEC setting: no             
    DNSSEC supported: no             
  Current DNS Server: 192.168.1.8    
         DNS Servers: 192.168.1.8    
                      192.168.1.127  
          DNS Domain: ~.             
                      argylecourt.lan
# [2022-07-17 09:10] maxg@x570 ~ $ 
resolvectl status enp3s0 
Link 2 (enp3s0)
      Current Scopes: DNS          
DefaultRoute setting: yes          
       LLMNR setting: yes          
MulticastDNS setting: no           
  DNSOverTLS setting: no           
      DNSSEC setting: no           
    DNSSEC supported: no           
  Current DNS Server: 192.168.1.127
         DNS Servers: 192.168.1.127
          DNS Domain: ~.           

I get it that .127 does not know about local names, but .8 does. And I thought pointing .127 to .8 would solve this problem.

I am aware that 192.168.1.127 is your Pi-hole.

The point I'm trying to get across - what is causing my confusion is this:

According to your own nslookup output, that statement is wrong:

That nslookup clearly shows that Server: 192.168.1.127 is supplying the correct reply for rpi32, and it is also more recent than the failing one, and the most recent output you've supplied.

That would suggest that -while there may have been an issue in the past- it's currently working.

EDIT: A side note on `systemd-resolved` (click for more)

A client that makes use of systemd-resolved may introduce its own specific particularities when it comes to DNS. Depending of which of its four modes it has decided to employ, DNS servers may or not have been acquired from the network or manually and may be applied or ignored by systemd-resolved, while same-machine client software may actually use or by-pass systemd-resolved for DNS (see systemd-resolved manpages).
(This would become even more complex on systems where NetworkManager is also installed and would be configured to use dnsmasq for certain connections, which would also be able to handle and cache DNS.)

In any case, systemd-resolved is not involved with your output so far, as your nslookup explicitly forced resolution through your Pi-hole at 192.168.1.127.

I think I understand your confusion now.

When I say my machine's DNS is pointing to .127, not nslookup .127

This is eample it my machine's DNS pointing to .8

nslookup rpi32 192.168.1.127
Server:		192.168.1.127
Address:	192.168.1.127#53

Non-authoritative answer:
Name:	rpi32.argylecourt.lan
Address: 192.168.1.8```

This one is the same nslookup, but with my machine's DNS being .127

nslookup rpi32 192.168.1.127
Server:		192.168.1.127
Address:	192.168.1.127#53

** server can't find rpi32: NXDOMAIN

In this case, I can no longer ssh rpi32, and results in:

ssh: Could not resolve hostname rpi32: Name or service not known

It would be irrelevant what your machine is using for DNS, as you are explicitly forcing the DNS request to your Pi-hole at 192.168.1.127.

Are you saying that you configure your Pi-hole to use itself as its upstream DNS server?

That would close a DNS loop.
In case that .127 would be Pi-hole's only upstream DNS, that would kill DNS resolution apart from Pi-hole's locally sourced DNS records.
In case of multiple upstream DNS, this may result in sporadic failures when .127 is used, but likely only noticeable as ocassionally longer reply times.

No...

Well, it seems otherwise... the only thing I am changing for these two different nslookup results is my machines' DNS.
For all these examples pi-hole has not been changed and is configured per original post.

In any case thank you for your support and hanging in there.

Of course!
That configuration may explain your observation, though attributing it to your machine's DNS configuration would have been only coincidental, as were your nslookup results.
So naturally, those nslookup results were kind of misleading. :wink:

If you don't define names within Pi-hole itself, Pi-hole has to source local hostnames from somewhere. In your case, that would be your 192.168.1.8.

When using that as one of Pi-hole's upstreams, local resolution will fail ocassionally whenever one of Google's DNS servers is used as upstream.

In order for that to work, you should either
a. untick Google's DNS and have 192.168.1.8 as Pi-hole's only upstream
or
b. untick 192.168.1.8 and enable Pi-hole's Conditional Forwarding instead.

For being 'coincidental', it is very repeatable. :slight_smile:

... and it continuous to be so, despite trying a. and b. as both inclusive and exclusive OR.

I was close of trying a. before you suggested it.

I have to take it on the chin that I looked at Advanced DNS Settings and dismissed these while thinking: no, we're not doing fancy or weird stuff.

And it reads clearly:

Conditional forwarding
If not configured as your DHCP server, Pi-hole typically won't be able to determine the names of devices on your local network. As a result, tables such as Top Clients will only show IP addresses.

In any case, I still have the same result, of not being able to resolve local names.
... and am giving up.

Again, thank you for trying to solve this.

FYI... with my machine's DNS set to .127
image

image

# [2022-07-17 22:40] maxg@x570 ~ $ 
nslookup rpi32
Server:		127.0.0.53
Address:	127.0.0.53#53

** server can't find rpi32: SERVFAIL

# [2022-07-17 22:40] maxg@x570 ~ $ 
nslookup rpi32 192.168.1.8
Server:		192.168.1.8
Address:	192.168.1.8#53

** server can't find rpi32: NXDOMAIN

# [2022-07-17 22:42] maxg@x570 ~ $ 
nslookup rpi32 192.168.1.127
Server:		192.168.1.127
Address:	192.168.1.127#53

** server can't find rpi32: NXDOMAIN


Jul 17 12:42:42 dnsmasq[28983]: query[A] rpi32 from 192.168.1.13
Jul 17 12:42:42 dnsmasq[28983]: cached rpi32 is NXDOMAIN

Now, that would mean that your 192.168.1.8 also would not know about local hostnames neither. :confused:.

I'm beginning to suspect that some kind of DNS traffic redirection may happen in your network.

To get an indication whether that would be the case:
When you force nslookups directly via Pi-hole and they result in failure, do those requests register in Pi-hole's Query Log at all?
If they don't, then its not Pi-hole, but some other instance that would be handling them.

If they do, are they correctly forwarded to 192.168.1.8?
If they are, what answer is 192.168.1.8 suppyling, if any?
If that answer is an NXDOMAIN, then your 192.168.1.8 doesn't know the answer.
If no answer is received, check your firewall on 192.168.1.8 whether it would allow requests from your Pi-hole machine.

nslookup rpi32 192.168.1.127
Server:		192.168.1.127
Address:	192.168.1.127#53
** server can't find rpi32: NXDOMAIN

Jul 17 13:20:11 dnsmasq[28983]: query[A] rpi32 from 192.168.1.13
Jul 17 13:20:11 dnsmasq[28983]: cached rpi32 is NXDOMAIN

... and no activity on port 53 of .8

... meaning this query is not forwarded to .8


nslookup rpi32 192.168.1.8
Server:		192.168.1.8
Address:	192.168.1.8#53

** server can't find rpi32: NXDOMAIN

shows port 53 activity on .8
23:28:50.383091 IP x570.argylecourt.lan.33072 > rpi32.argylecourt.lan.domain: 13916+ A? rpi32. (23)
23:28:50.383860 IP rpi32.argylecourt.lan.domain > x570.argylecourt.lan.33072: 13916 NXDomain 0/1/0 (98)


I wouldn't know what should redirect DNS queries somewhere.
There are no firewalls on servers, other than the router to the Internet.
As per original post, there is only .8 and .127 set-up as DNS.


So we can say .127 does not forward the query to .8

We haven't established that.

It means that 192.168.1.8 is not receiving traffic (EDIT: In that specific case, because the answer was provided from Pi-hole's cache. It doesn't tell us how that request was handled before it has been cached).

You can verify how Pi-hole handles those requests by inspecting its Query Log, or do so in real-time and greater detail by running and observing

pihole -t

or Tools | Tail pihole.log.

That should allow you to find the answers to the questions from my previous post.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.