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?
>>
>>
-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemen...@redhat.com
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB


_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to