Dear Geert,

thanks for your answer!
Yes, if remove the line (so, enable the dns-server), I see that the /etc/hosts
is read and then the host gets the correct IP-address of trb.

Actually, this workaround is fine for many distributions, but I realized that
in Ubuntu the systemd-resolve is on by default and this is in conflict the the
dnsmasq-dns-server. Disabling the systemd-resolve causes other error messages
and needs more changes in the setup of Ubuntu to get everything silent, but
I'm not sure of other side effects.

Greetings,

Michael

---------------------------------------

On Sat, 22 Oct 2022, Geert Stappers via Dnsmasq-discuss wrote:

Date: Sat, 22 Oct 2022 21:15:46
From: Geert Stappers via Dnsmasq-discuss
    <dnsmasq-discuss@lists.thekelleys.org.uk>
Reply-To: Geert Stappers <stapp...@stappers.nl>
To: dnsmasq-discuss@lists.thekelleys.org.uk
Subject: Re: [Dnsmasq-discuss] dnsmasq: dhcp-server with disabled dns-server:
    /etc/hosts ignored

On Fri, Oct 21, 2022 at 11:23:28PM +0200, 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=<fn>
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? :-)

Or an incomplete  configuration file.

So remove the 'port=0' (or comment it out) and check if
the host with MAC-address gets the IP-address of trb.

And report back.



Groeten
Geert Stappers


_______________________________________________
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