Re: [Dnsmasq-discuss] The order of nameservers provided by `server=`

2019-03-25 Thread Geert Stappers
On Tue, Mar 26, 2019 at 01:30:37AM +0800, Fox Haxx wrote:
> On Mon, Mar 25, 2019 at 05:19:58PM +, John Robson wrote:
> > Does that not only apply to those in /etc/resolv.conf (or the overridden 
> > file)
> 
> My tests show that it applies to all configured nameservers.
> 
> The man page needs updating to reflect this, I think. In many places where it
> refers to /etc/resolv.conf it in fact means all the nameservers. At least
> that's the only reasonable behavior I can intuit.

Source of manual page is man/dnsmasq.8
The git clone URL is git://thekelleys.org.uk/dnsmasq.git ( or 
http://thekelleys.org.uk/git/dnsmasq.git )

After your changes `git format-patch` plus `git send-email`
and see what happens.


Groeten
Geert Stappers
-- 
Leven en laten leven

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] The order of nameservers provided by `server=`

2019-03-25 Thread wkitty42

On 3/25/19 12:14 PM, John Robson wrote:
Don’t think dnsmasq cares what order they are in, it tests them all and chooses 
the fastest to use.



then what good is "strict-order"??


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list unless*
   *a signed and pre-paid contract is in effect with us.*

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] The order of nameservers provided by `server=`

2019-03-25 Thread Fox Haxx
> Let' say I have this config:
> 
> server=
> server=
> resolv-file=/etc/dnsmasq-resolv.conf
> strict-order
> 
> By running dnsmasq with `--log-queries` I discovered that  is actually
> listed above :
> 
> dnsmasq: using nameserver 
> dnsmasq: using nameserver 
> dnsmasq: using nameserver 192.168.1.1#53
> dnsmasq: read /etc/hosts - 2 addresses
> dnsmasq: query[A] x.org from 127.0.0.1
> dnsmasq: forwarded x.org to 
> dnsmasq: reply x.org is 131.252.210.176
> 
> Which is to say, every `server=` server is _prepended_ to servers list, rather
> than _appended_.
> 
> I think this is counter-intuitive.
> 
> So is this intended?
> Is it documented?
> Should it be changed?
> 

Further testing shows another thing that surprises me: no matter whether the
`resolv-file=` is above the `server=` lines or below them, the nameservers in
the resolv-file is _always appended_ to the list of servers produced by
`server=` lines.

For example, this config:

server=
server=
resolv-file=/etc/dnsmasq-resolv.conf
strict-order

is equivalent to this:

resolv-file=/etc/dnsmasq-resolv.conf
server=
server=
strict-order

which both produce this queries log:

dnsmasq: using nameserver 
dnsmasq: using nameserver 
dnsmasq: reading /etc/dnsmasq-resolv.conf
dnsmasq: using nameserver 
dnsmasq: using nameserver 
dnsmasq: using nameserver 192.168.1.1#53
dnsmasq: read /etc/hosts - 2 addresses
dnsmasq: query[A] x.org from 127.0.0.1
dnsmasq: forwarded x.org to 
dnsmasq: reply x.org is 131.252.210.176

This is not very intuitive either.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] The order of nameservers provided by `server=`

2019-03-25 Thread John Robson
Does that not only apply to those in /etc/resolv.conf (or the overridden
file)

On Mon, 25 Mar 2019 at 17:17, Fox Haxx  wrote:

> > Don’t think dnsmasq cares what order they are in, it tests them all and
> chooses the fastest to use.
>
> By default, true, however, note I used the `strict-order` option.
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] The order of nameservers provided by `server=`

2019-03-25 Thread Fox Haxx
> Does that not only apply to those in /etc/resolv.conf (or the overridden file)

My tests show that it applies to all configured nameservers.

The man page needs updating to reflect this, I think. In many places where it
refers to /etc/resolv.conf it in fact means all the nameservers. At least
that's the only reasonable behavior I can intuit.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] The order of nameservers provided by `server=`

2019-03-25 Thread Fox Haxx
> Don’t think dnsmasq cares what order they are in, it tests them all and 
> chooses the fastest to use.

By default, true, however, note I used the `strict-order` option.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] The order of nameservers provided by `server=`

2019-03-25 Thread John Robson
Don’t think dnsmasq cares what order they are in, it tests them all and
chooses the fastest to use.

On Mon, 25 Mar 2019 at 16:00, Fox Haxx  wrote:

> Let' say I have this config:
>
> server=
> server=
> resolv-file=/etc/dnsmasq-resolv.conf
> strict-order
>
> By running dnsmasq with `--log-queries` I discovered that  is actually
> listed above :
>
> dnsmasq: using nameserver 
> dnsmasq: using nameserver 
> dnsmasq: using nameserver 192.168.1.1#53
> dnsmasq: read /etc/hosts - 2 addresses
> dnsmasq: query[A] x.org from 127.0.0.1
> dnsmasq: forwarded x.org to 
> dnsmasq: reply x.org is 131.252.210.176
>
> Which is to say, every `server=` server is _prepended_ to servers list,
> rather
> than _appended_.
>
> I think this is counter-intuitive.
>
> So is this intended?
> Is it documented?
> Should it be changed?
>
>
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] The order of nameservers provided by `server=`

2019-03-25 Thread Fox Haxx
Let' say I have this config:

server=
server=
resolv-file=/etc/dnsmasq-resolv.conf
strict-order

By running dnsmasq with `--log-queries` I discovered that  is actually
listed above :

dnsmasq: using nameserver 
dnsmasq: using nameserver 
dnsmasq: using nameserver 192.168.1.1#53
dnsmasq: read /etc/hosts - 2 addresses
dnsmasq: query[A] x.org from 127.0.0.1
dnsmasq: forwarded x.org to 
dnsmasq: reply x.org is 131.252.210.176

Which is to say, every `server=` server is _prepended_ to servers list, rather
than _appended_.

I think this is counter-intuitive.

So is this intended?
Is it documented?
Should it be changed?


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss