# DNS not resolving queries to local upstream

**URL:** <https://discourse.pi-hole.net/t/dns-not-resolving-queries-to-local-upstream/10178>\
**Category:** Help\
**Created:** [June 8, 2018, 5:25am UTC](https://discourse.pi-hole.net/t/dns-not-resolving-queries-to-local-upstream/10178 "2018-06-08T05:25:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![veldthui](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/v/bbce88/32.png) [@veldthui](https://discourse.pi-hole.net/u/veldthui)\
**Post date:** [June 8, 2018, 5:25am UTC](https://discourse.pi-hole.net/t/dns-not-resolving-queries-to-local-upstream/10178/1 "2018-06-08T05:25:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [June 8, 2018, 6:12am UTC](https://discourse.pi-hole.net/t/dns-not-resolving-queries-to-local-upstream/10178/2 "2018-06-08T06:12:29Z")

</div>

There is nothing like a _primary_ or _secondary_ DNS server.

See this for more details:

> [@Primary vs. Secondary DNS](https://discourse.pi-hole.net/t/primary-vs-secondary-dns/1536/2):
>
> Following the regulations, there is nothing like a primary and secondary DNS server. These indications are quite misleading but many systems adopted it this way. We only list the DNS servers as primary and secondary, because this is what the providers write on their pages. The bad phrasing is supported especially by how Windows handles it. If you look at any Linux distribution, there is usually no separation between primary and secondary, but you can only provide a comma-separated list of DNS se…

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

---

<div class="post-metadata">

**Author:** ![veldthui](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/v/bbce88/32.png) [@veldthui](https://discourse.pi-hole.net/u/veldthui)\
**Post date:** [June 8, 2018, 9:06pm UTC](https://discourse.pi-hole.net/t/dns-not-resolving-queries-to-local-upstream/10178/3 "2018-06-08T21:06:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [June 9, 2018, 6:27am UTC](https://discourse.pi-hole.net/t/dns-not-resolving-queries-to-local-upstream/10178/4 "2018-06-09T06:27:24Z")

</div>

> [@veldthui](#):
>
> Will have a look to see about the strict-order option but really a noobie on dns.

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

```auto
strict-order

```

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

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [June 30, 2018, 6:27am UTC](https://discourse.pi-hole.net/t/dns-not-resolving-queries-to-local-upstream/10178/5 "2018-06-30T06:27:25Z")

</div>

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