[Dnsmasq-discuss] Behavior change of upstream servers set via DBus

Jerry Xiao dnsmasq at mail.jerryxiao.cc
Tue Nov 16 02:42:15 UTC 2021


Thanks for your help.

According to my test, "server=/./1.1.1.1" is the same as
"server=1.1.1.1", the suffix dot is stripped before constructing a
server struct.

That domain list is from
https://github.com/felixonmars/dnsmasq-china-list
I need redirection because it's the list of "clean" domains, anything
not inside the list can be considered "dirty". Currently in dnsmasq
there's no way to negate a rule.

On Tue, 2021-11-16 at 02:28 +0100, Petr Menšík wrote:
> Hi Jerry,
> 
> I haven't tried it, but can you try server=/./1.1.1.1? Because
> google.com is more specific, it should forward everything to 1.1.1.1,
> but google.com subdomains to default servers. It is possible
> refactoring
> has broken this case, because it is probably uncommon.
> 
> What is source of such big domain list? Usually so big number of
> domains
> is used only for blocking. Why do you need redirection, may I ask?
> 
> There were some issues fixed after 2.86 release. Have you tried
> building
> from latest source? Maybe it is fixed, but not yet released.
> 
> Regards,
> Petr
> 
> On 11/9/21 12:59, Jerry Xiao wrote:
> > So how can I achieve the same behavior as "server=/#/1.1.1.1" from
> > dnsmasq 2.85?
> > 
> > On Tue, 2021-11-09 at 10:33 +0100, Matus UHLAR - fantomas via
> > Dnsmasq-
> > discuss wrote:
> > > On 09.11.21 17:02, Jerry Xiao wrote:
> > > > With dnsmasq 2.85 I was able to do the following:
> > > > 1. set upstream servers (lets say 192.168.1.1) via dbus from
> > > > the
> > > > dhcp
> > > > client, in my case it was networkmanager.
> > > > 2. add the following config (dnsmasq 2.85):
> > > > server=/google.com/#
> > > > server=/#/1.1.1.1
> > > > 
> > > > So that only google.com and its subdomains are forwarded to the
> > > > upstream server (192.168.1.1) while requests for any other
> > > > domains
> > > > went
> > > > ahead to 1.1.1.1.
> > > > However with the recent update of dnsmasq 2.86 I noticed that
> > > > the
> > > > same
> > > > config above would not work. It seems that the right syntax for
> > > > "server=/#/1.1.1.1" has become "server=//1.1.1.1". This isn't
> > > > the
> > > > biggest problem though.
> > > > 
> > > > with this new config (dnsmasq 2.86):
> > > > server=/google.com/#
> > > > server=//1.1.1.1
> > > > 
> > > > Now every single domain (including google.com) is forwarded to
> > > > the
> > > > upstream server (192.168.1.1) set via the dbus api instead of
> > > > 1.1.1.1,
> > > that's because the:
> > > 
> > > server=/google.com/#
> > > 
> > > means to send the "google.com" requests to default upstream
> > > server:
> > > 
> > >     The special server address '#' means, "use the standard
> > > servers",
> > > so
> > >     --server=/google.com/1.2.3.4 --server=/www.google.com/# will
> > > send
> > >     queries for *.google.com to 1.2.3.4, except *www.google.com
> > > which
> > > will
> > >     be forwarded as usual.
> > > 
> > > while the:
> > > 
> > > server=//1.1.1.1
> > > 
> > > means to send UNQUALIFIED hosts to 1.1.1.1
> > > 
> > > 
> > > > which is an unexpected behavior change from the previous
> > > > version.
> > > > Setting the upstream server (192.168.1.1) with this config line
> > > > "server=192.168.1.1" without dbus works, though.
> > > > 
> > > > Is there something wrong with the new upstream server selection
> > > > logic?
> > > 
> > > 





More information about the Dnsmasq-discuss mailing list