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
Define DNS priority
Moderator: Moderators
Re: Define DNS priority
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'
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
Hi
but how do i define what DNS is the 1st and the rest of the order?
that line ony say to 1?
thanks
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
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
open /etc/config/network
search for
Code: Select all
config interface 'wan'
Code: Select all
option dns 'IP1 IP2 IP3'
Second dns listend second highest priority.
And so on.
Do the same for
Code: Select all
config interface 'lan'
Re: Define DNS priority
No problem nbexiga, you're welcome 

Re: Define DNS priority
@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:
In looking for more on this, I found this post from a longtime poster over on DD-WRT:
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:
OK, so I looked there and found this: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
Only localhost is there. So in the case of a router, is strictorder doing anything at all?search lan
nameserver 127.0.0.1
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
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
Because of this, I'm reminded of the problem again.
https://www.quad9.net
Re: Define DNS priority
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.
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.