[Dnsmasq-discuss] [PATCH] --local is broken

Simon Kelley simon at thekelleys.org.uk
Tue Oct 5 22:18:59 UTC 2021

On 05/10/2021 21:50, Petr Menšík wrote:
> I have already reported it, but might got lost in different thread.
> https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2021q3/015723.html
> I took a look at the change, it seems it was intentional. Your proposed
> change would break something else Simon tried to fix in commit 26bbf5a3
> I think.
> I think --address=/#/ got broken. Which should be roughly
> equivalent to --address=/./, now that just . is accepted itself.
> It got threated as --address=// in previous versions by mistake.
> Your fix would restore --local=/test/, but would break this part
> again. 

I can't find an example of that. I think Dominik's patch is correct.
(though I have to admit, I can't remember what problem I was trying to
solve with the change from option == 'A' to option != 'S'. Whatever it
was is spurious, as far as I can tell now.

We now have the situation that


all now do exactly the same thing, which is curious, but not a disaster.

> That is why I had not attached patch to it, because correct fix
> it more demanding. And address+server parsing is complicated enough now.
> I think --local should emit warning if used with an address. I think its
> intention was to be used just with domains like --local=/invalid/,
> entries containing server also should use --server instead.

That may be what I was trying to fix. If the man page says that --local
is a synonym for --server, then it should be. Clearly from Dominik's
error reports, his users have been using --local=/example.com/
and understanding its sematics OK.



> Cheers,
> Petr
> On 10/5/21 20:52, Dominik Derigs wrote:
>> Hey Simon,
>> Since commit "Fix --address=/#/...... which was lost in 2.86"
>> (26bbf5a314d833beaf0f147d24409969f05f3dba) --local being a
>> synonym for --server is broken as --local became a synonym for --
>> address.
>> The attached patch fixes this.
>> This was reported on the Pi-hole forums:
>>> I have local=/fritz.box/ in my /etc/dnsmasq.d/02-
>>> localdns.conf config file. This worked fine until upgrading
>>> pihole last night. Now all queries to FQDNs such as google.com
>>> get responded with google.com.fritz.box and ip address
>>> Changing the line to server=/fritz.box/ restores the
>>> previous handling. However, according to the dnsmasq manpage "-
>>> -local is a synonym for --server to make configuration files
>>> clearer in this case."
>> Best,
>> Dominik
>> _______________________________________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss at lists.thekelleys.org.uk
>> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
> -- 
> Petr Menšík
> Software Engineer
> Red Hat, http://www.redhat.com/
> email: pemensik at redhat.com
> PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

More information about the Dnsmasq-discuss mailing list