Re: [Dnsmasq-discuss] DNS set using dhcp-host doesn't exist until it connects?

2020-04-21 Thread Geert Stappers
On Mon, Apr 20, 2020 at 10:27:11PM -0400, Jiawen Chen wrote:
> Hi,
> 
> I recently started exploring the more advanced features of dnsmasq and have
> been very impressed.

   :-)

> 
 ... good  reports ...

> 
> Any suggestions would be greatly appreciated!

Separate issues should have seperate mail threads.
(now work in progress)
 

Groeten
Geert Stappers
-- 
Silence is hard to parse

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


[Dnsmasq-discuss] DNS set using dhcp-host doesn't exist until it connects?

2020-04-20 Thread Jiawen Chen
Hi,

I recently started exploring the more advanced features of dnsmasq and have
been very impressed.

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?

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)).

dnsmasq.conf:
```
# other irrelevant stuff

no-resolv
server=8.8.8.8
server=8.8.4.4
server=1.1.1.1

expand-hosts
domain-needed
bogus-priv
local=/internal/

# Assign 192.168.0.150 to my living room pc
dhcp-host=,192.168.0.150,livingroom.internal,infinite

# Assign 192.168.0.151 to my file server
dhcp-host=,192.168.0.151,fileserver.internal,infinite
```

For these static DHCP leases, is the best practice to set them in
/etc/hosts instead?

I also discovered --host-record, which does something very similar. Is
there an advantage in using one option vs the other?


Finally, I'd like to use DHCPv6 and IPv6, using the host-id-only option.
E.g., the above becomes:

```
# Enable IPv6 Router Advertisement.
enable-ra

# Enable DHCPv6. Serve a range for each VLAN.
dhcp-range=::0:2,::0:500,constructor:br0,slaac

# Assign 192.168.0.150 and [::0:1000] to my living room pc
dhcp-host=,192.168.0.150,[::0:1000],livingroom.internal,infinite

# Assign 192.168.0.151 and [::0:1001] to my file server
dhcp-host=,192.168.0.151,[::0:1001],fileserver.internal,infinite
```

Sadly, the host-id-only notation ([::0:1000]) does not appear permitted
when dnsmasq parses /etc/hosts.

Any suggestions would be greatly appreciated!

Thanks,

Jiawen Chen
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss