Page 1 of 1
Define DNS priority
Posted: Fri Sep 25, 2015 9:37 am
by nbexiga
Hi
I have gargoyle 8.0 and i defined 4 dns in the configuration.
But i want to ensure that i can define the DNS search order. for 1st to the last one that i want.
is it possible?
thanks
Re: Define DNS priority
Posted: Mon Sep 28, 2015 4:16 pm
by shm0
Hi
Add the following line to your dhcp config in /etc/config/dhcp
(You have to login via ssh and edit it with vi or use winscp to edit the file)
option strictorder '1'
Re: Define DNS priority
Posted: Tue Sep 29, 2015 8:24 am
by nbexiga
Hi
but how do i define what DNS is the 1st and the rest of the order?
that line ony say to 1?
thanks
Re: Define DNS priority
Posted: Tue Sep 29, 2015 9:19 am
by shm0
Hi
open /etc/config/network
search for
edit
The first dns listed has highest priority.
Second dns listend second highest priority.
And so on.
Do the same for
Re: Define DNS priority
Posted: Tue Sep 29, 2015 10:12 am
by nbexiga
MANY THANKS

Re: Define DNS priority
Posted: Wed Sep 30, 2015 11:39 am
by shm0
No problem nbexiga, you're welcome

Re: Define DNS priority
Posted: Fri Aug 19, 2016 3:03 pm
by rseiler
@shm0, a follow-up or two on this if you don't mind, as I try to understand the ramifications.
I only started wondering about all this after noting that the DNS order as listed on the Connection/Basic page and /etc/config/network do not agree with what's shown on the Status page.
Just to get this out of the way, I noticed that once custom DNS are set in the GUI, the lines in /etc/config/network are already done, at least they are today (not sure about a year ago).
But I'm wondering whether the strictorder line in /etc/config/dhcp is advisable.
First, in looking up what it meant, I found:
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
OK, so I looked there and found this:
search lan
nameserver 127.0.0.1
Only localhost is there. So in the case of a router, is strictorder doing anything at all?
In looking for more on this, I found this post from a longtime poster over on DD-WRT:
And btw, NEVER EVER use strict-order w/ DNSMasq. That directive does NOT work the way ppl think. I have no idea why they suddenly added it to the GUI. It's misleading. Strict-order tries the first nameserver, and if it fails, returns an error to the client, then waits for the client to retry (assuming it does, which is part of the problem, many clients don't). Then it tries the second nameserver, and if it fails, waits for the client to try again. And so on. It has the effect of breaking DNS if it happens the first nameserver doesn't work. Just a really dumb option that should never have been added to DNSMasq imo.
Re: Define DNS priority
Posted: Fri Nov 17, 2017 2:10 am
by rseiler
Can any light be shed on these questions? If it is a sound practice, and it sounds like it isn't, maybe the option should be put in the UI? Or maybe there's a better way?
Because of this, I'm reminded of the problem again.
https://www.quad9.net
Re: Define DNS priority
Posted: Thu Apr 05, 2018 12:33 am
by rseiler
Now 1.1.1.1 has come along and is one that many might actually want to position first and only use their ISP's DNS as a fallback.
DNS options are more varied than ever, so shouldn't the UI be able to handle ordering, and in the process maybe even add the words "Primary" and "Secondary" etc to make it clear that they're not just being added randomly?
Also, there's the whole outstanding issue with 'strictorder'. which might become moot if changes are made to the UI, but in the meantime is relevant.