DNS not resolving queries to local upstream

Having problems with having to restart the dns quite often. I have it pointing to my domain controller dns server as the first upstream and then a google as a second.
Works fine for ages then suddenly will stop returning valid IP. Looking at the pihole log it says it has allowed it (cached ok) but the pc says can't find the IP.

I restart the dns resolver on pihole and flush the dns cached on the PC and it is away again. It is not always the same IP and they are local IP's. Can't see anything in the logs that show as an error.

There is nothing like a primary or secondary DNS server.

See this for more details:

What you see seems to be correct. You need to change your configuration as you cannot rely on that one of the servers is getting preferred. If you still want to set it up like this, the strict-order option may be helpful:

By default, dnsmasq will send queries to any of the upstream servers it knows about and tries to favour servers that are known to be up. Setting this flag forces dnsmasq to try each query with each server strictly in the order they appear in /etc/resolv.conf

Okay thanks. I had thought it would service requests from the first one and then if no reply or could not find then it would try the second. Sounds like it is a send to both and take the first response.

I would still like it to use the first one so that it picks up the local IP's defined on the domain dns server and go for the second if no response due to being down for updates or something.

Will have a look to see about the strict-order option but really a noobie on dns. Guess I will just remove the Google reference if all else fails.

Just create a new file like /etc/dnsmasq.d/strict-order.conf and put


into this file. Run pihole restartdns afterwards and see if it works as expected.

1 Like

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