<div dir="ltr"><span style="color:rgb(0,0,0)">Hi,</span><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">I recently started exploring the more advanced features of dnsmasq and have been very impressed.</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">TL;DR: as the subject line says, is the DNS name assigned by dnsmasq not persistent? I.e., it only exists once the device has connected?</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">I'm using dnsmasq for DHCP + DNS on my home LAN and use dhcp-host to statically assign an IP address and hostname. However, I'm discovering that while it works most of the time, sometimes, ssh for example, can't find the host by name, only IP. One instance is a Linux VM. Initially I can ssh into the VM. But if I power down the VM for say a few days, and start it back up, the name is missing (even though it is somehow assigned the same IP (it keeps its MAC)).</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">dnsmasq.conf:</div><div style="color:rgb(0,0,0)">```</div><div style="color:rgb(0,0,0)"># other irrelevant stuff</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">no-resolv</div><div style="color:rgb(0,0,0)">server=8.8.8.8<br>server=8.8.4.4<br>server=1.1.1.1<br></div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">expand-hosts</div><div style="color:rgb(0,0,0)">domain-needed</div><div style="color:rgb(0,0,0)">bogus-priv</div><div style="color:rgb(0,0,0)">local=/internal/</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)"># Assign 192.168.0.150 to my living room pc</div><div style="color:rgb(0,0,0)">dhcp-host=<livingroom_pc_MAC_redacted>,192.168.0.150,livingroom.internal,infinite</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)"># Assign 192.168.0.151 to my file server</div><div style="color:rgb(0,0,0)">dhcp-host=<fileserver_MAC_redacted>,192.168.0.151,fileserver.internal,infinite<br></div><div style="color:rgb(0,0,0)">```</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">For these static DHCP leases, is the best practice to set them in /etc/hosts instead?<br></div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">I also discovered --host-record, which does something very similar. Is there an advantage in using one option vs the other?</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">Finally, I'd like to use DHCPv6 and IPv6, using the host-id-only option. E.g., the above becomes:</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">```</div><div style="color:rgb(0,0,0)"># Enable IPv6 Router Advertisement.<br>enable-ra<br><br># Enable DHCPv6. Serve a range for each VLAN.<br>dhcp-range=::0:2,::0:500,constructor:br0,slaac<br></div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)"><div># Assign 192.168.0.150 and [::0:1000] to my living room pc</div><div>dhcp-host=<livingroom_pc_MAC_redacted>,192.168.0.150,[::0:1000],livingroom.internal,infinite</div></div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)"><div># Assign 192.168.0.151 and [::0:1001] to my file server</div><div>dhcp-host=<fileserver_MAC_redacted>,192.168.0.151,[::0:1001],fileserver.internal,infinite<br></div><div>```</div><div><br></div><div>Sadly, the host-id-only notation ([::0:1000]) does not appear permitted when dnsmasq parses /etc/hosts.</div><div><br></div><div>Any suggestions would be greatly appreciated!</div><div><br></div><div>Thanks,</div><div><br></div><div>Jiawen Chen</div></div></div>