<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 9/13/23 13:18, TRUNKLES via
Dnsmasq-discuss wrote:<br>
</div>
<blockquote type="cite"
cite="mid:UHrTfpra3-oI6i3ANLhQfA9xV9LdPxlKJU44DbhXz76sEwANKgV94zK1O64lQL4x04uK7EQ1VAOfvKK84c-IUzhVs2qH7utT1EqJkAT_wD8=@protonmail.ch">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
I'd like to start by just asking a simple question I've not
managed to find an answer to anywhere else: are /etc/ethers and
/etc/hosts supposed to supersede dynamic IP allocaiton? Suppose
I have all of my "known" devices (MAC addresses) in /etc/ethers,
are those supposed to appear to dnsmasq as implicit --dhcp-host=
declarations, to take precedence over dynamic host IP allocation
as provided by --dhcp-range= statements in the conf file?<br>
<br>
And as for the things that don't work at all part: As deployed,
probably badly configured by me, dnsmasq is apparently
recognising the /etc/ethers entry and matching it with
/etc/hosts, because that shows up and looks good in
/var/lib/misc/dnsmasq.leaes, but then, also allocating it a
dynamic IP address, which results in entries like this:<br>
<br>
<span>1694633632 41:c4:b7:ff:16:a3 192.168.111.126
192.168.111.20 # media-server *</span><br>
<span></span><br>
That not only looks wrong, but is wrong enough that if I stop
dnsmasq and then restart it, it refuses to run until I've
deleted that file. Clearly, I've done something terrible
somewhere, but I still find it interesting that dnsmasq would
produce a lease file that is so wrong that it segfaults upon
trying to read it back upon restart.</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
</div>
</blockquote>
<p><br>
</p>
<p><br>
</p>
<p>Hi Trunkles,</p>
<p><br>
</p>
<p>I made the switch from ISC named/dhcp a long time ago and
remember some growing pains. For sure, dnsmasq can do what
you find and I actually prefer it to other solutions for home
use. Personally, I don't use the ethers file at all and
prefer to do my matching in the
/etc/dnsmasq.d/<something>.conf files. So my sample config
might look something like this:</p>
<p><br>
</p>
<p><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">dhcp-range=lan,192.168.101.100,192.168.101.200,96h</span><br>
</span><br>
<span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">dhcp-option=tag:lan,option:router,192.168.101.1</span><br>
</span></span><br>
<span style="font-family:monospace"><span
style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">dhcp-option=option:dns-server,192.168.101.2</span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">dhcp-option=option:tzdb-timezone,"America/<City>"</span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">dhcp-option=15,"<internal
domain>" # Domain name</span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">domain=<internal
domain>
</span><br>
expand-hosts
<br>
localise-queries</span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">dhcp-host=30:05:5c:7b:36:b5,hostA</span><br>
dhcp-host=0c:9d:92:10:a1:8c,hostB<br>
dhcp-host=04:17:b6:67:80:3c,hostC</span></span></span></span></span></p>
<span style="font-family:monospace"></span><span
style="font-family:monospace"><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace"></span></span></span></span></span>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace"><br>
</span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace">I only create dhcp-host
entries for hosts that I want to be static in assigment
via DHCP. They would have a corresponding /etc/hosts
entry where dnsmasq would find the IP.</span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace">My hosts file might
contain:</span></span></span></span><span
style="color:#000000;background-color:#ffffff;"><br>
</span></span></p>
<p><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">192.168.101.3
hostA </span><br>
192.168.101.4 hostB
<br>
192.168.101.5 hostC<br>
<br>
<br>
</span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace"></span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace">Fully dynamic hosts will
just get assigned a host from the pool and dnsmasq will
use the client supplied hostname to do local DNS lookups
on those.</span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace">From there, you can get
into more details like using tags to assign different
values to different clients, etc but lets get the basics
working first.</span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace">If you want more specific
help, it would be useful to post your config file so we
can look for issues.</span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace"><br>
</span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace">Michael</span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace"><br>
</span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace"><br>
</span></span></span></span></span></p>
<p><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><span
style="font-family:monospace"><span
style="font-family:monospace">
<br>
</span></span> </span><br>
</span>
<br>
<br>
</span><span style="font-family:monospace"><span
style="font-family:monospace"><span
style="font-family:monospace"></span></span></span></p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>