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

Matus UHLAR - fantomas uhlar at fantomas.sk
Mon Jan 23 15:34:14 UTC 2023


Hello,

in an addition to an older thread:

>>On 21/10/2022 22:23, Michael Traxler wrote:
>>>When you disable the DNS-server via
>>>port=0
>>>
>>>the /etc/hosts file is ignored and also the
>>>addn-hosts=<fn>
>>>is ignored.

If one wants to disable reading /etc/hosts when DNS is disabled, using 
option "-h" is easy alternative which adds possibility to read other host 
file.

/etc/hosts does job similar as /etc/ethers, and while the latter has to be 
turned on by default using "-Z", /etc/hosts is usable at all times.

>On 31.10.22 21:07, Simon Kelley wrote:
>>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, 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.
>>
>>
>>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.

On 02.11.22 09:53, Matus UHLAR - fantomas via Dnsmasq-discuss wrote:
>I believe that /etc/hosts is generic database which is used for 
>name<->IP mapping wherever it's needed. This should imho include 
>static DHCP configuration.
>
>I also believe that the resources part is not important nowadays.

-- 
Matus UHLAR - fantomas, uhlar at 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.
(R)etry, (A)bort, (C)ancer



More information about the Dnsmasq-discuss mailing list