Re: [Dnsmasq-discuss] dnsmasq: dhcp-server with disabled dns-server: /etc/hosts ignored

2022-11-01 Thread Geert Stappers via Dnsmasq-discuss
On Mon, Oct 31, 2022 at 09:07:40PM +, Simon Kelley wrote:
> On 21/10/2022 22:23, Michael Traxler wrote:
> > Hello,
> > 
> > dnsmasq-2.87:
> > 
> > It took me quite some time to figure this out :-)
> > 
> > When you disable the DNS-server via
> > port=0
> > 
> > the /etc/hosts file is ignored and also the
> > addn-hosts=
> > is ignored.
> > 
> > This then results in the problem, that the
> > DHCP-server still works, but if you use the
> > 
> > dhcp-host=da:7a:3a:62:7d:d2,trb
> > 
> > where trb is a name in /etc/hosts
> > dnsmasq reacts with:
> > 
> > DHCPDISCOVER(enp2s0) da:7a:3a:62:7d:d2 no address available
> > 
> > I checked via strace that it really doesn't even open
> > /etc/hosts nor the given file via the "addn-hosts" option.
> > 
> > Looks for me like a bug. I can not find a logical reason, why a dhcp-server
> > *needs* to have a running DNS-server.
> > 
> > Or is it a feature? :-)
> 
> It's at least a documentation bug. I think the reasoning behind the
> behaviour is that setting port=0 disables all the DNS functionality, which
> can be useful for its own sake, but also saves machine resources; no memory
> is allocated for cache and all the configuration infrastructure for DNS is
> not initialised, hence /etc/hosts doesn't get read.
> 
> It would be trivial to remove half a dozen "if (port != 0) {   }" lines from
> the code, and have all of the DNS stuff still live apart from actually
> listening on port 53,

Nice


> but that's not necessarily an improvement.  There's not increase in
> functionality, since the same behaviour can be configured simply by
> adding the the addresses to the dhcp-host lines and that works with
> the existing code even when port=0 is set.

An already mentioned improvement is /etc/hosts content being respected.
The
> > dhcp-host=da:7a:3a:62:7d:d2,trb
> > 
> > where trb is a name in /etc/hosts dnsmasq reacts with:
from above.


> My feeling is that the best fix to this is a heads-up in the man page,
> but I'm happy to entertain arguments to the contrary.

 
> Simon.
 

Groeten
Geert Stappers
-- 
Silence is hard to parse

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


Re: [Dnsmasq-discuss] DNS recursion only works in debug mode

2022-11-01 Thread Matus UHLAR - fantomas via Dnsmasq-discuss

On Mon, Oct 31, 2022 at 03:59:56PM +0100, Matus UHLAR - fantomas via 
Dnsmasq-discuss wrote:

I have upgraded my router which included upgrading dnsmasq 2.80 to 2.86.

(Turris OS 5.4.4 based on openwrt 19 to 6.0.1 based on OpenWrt 21.02.05)

in the current version, dnsmasq returns REFUSED for external lookups:


[...]


when I run dnsmasq with "-d" alias "--no-daemon" option, resolving works:


On 31.10.22 21:28, Geert Stappers via Dnsmasq-discuss wrote:

Manual page says about the debug mode, among others, "don't change user
id".  Idea / shoot in the dark:  The configuration file has 'user=foo'
and user `foo` not allowed to connect to upstream name server.


this was the hint I needed, thanks.

and look like this was the culprit:

dnsmasq: reading /tmp/resolv.conf.d/resolv.conf.auto

...
drw-r--r--2 root root60 Oct 31 14:27 /tmp/resolv.conf.d

changing permissions here did the job.

--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Micro random number generator: 0, 0, 0, 4.33e+67, 0, 0, 0...

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


Re: [Dnsmasq-discuss] Reserved IP Addresses for Specific DHCP Clients without a Connection to the Subnet

2022-11-01 Thread john doe

On 10/31/22 22:15, Simon Kelley wrote:



On 27/10/2022 18:02, Rich Otero wrote:

Simon,

    dhcp-host=set:wierd,,192.168.6.7


Are you sure that this is correct? According to the manual, the
signature of dhcp-host is this:


--dhcp-host=[][,id:|*][,set:][,tag:][,][,][,][,ignore]


The relevant bit: ,set:,

But your example is: set:,,


The parser for dhcp-host accepts the various data types in any order and
analyses the comma-delimited strings with various heuristics to work out
what it's seeing. This seemed like a great idea at the time, but if I
could communicate with 2002-Simon I'd probably tell him to find another
way. There have been bugs when the heuristics were not as clever as they
should have been, and confusion when they are a bit too clever. This is
compounded by the fact that it's very difficult to tell that the parser
has silently treated your MAC address as a hostname because you
substituted an o for 0 or something similar.


Too late now, it is what it is.



I also always wonderd about this, is one syntax less error prone then an
other?

--
John Doe


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