[Dnsmasq-discuss] DNS from dhcp-host while client is offline

Alkis Georgopoulos alkisg at gmail.com
Mon Oct 4 09:52:26 UTC 2021


Thank you Petr,

indeed I wouldn't mind at all to add a `,forever` in these dhcp-host 
lines if it automatically added them to DNS without having to boot them.
Or to use a `dhcp-range=....,some-flag` syntax.

Fortunately a script that converts from dhcp-hosts to addn-hosts was 
rather easy to implement, so I'm happily using that.

Thank you all!
Alkis


On 10/4/21 12:45 PM, Petr Menšík wrote:
Hi Alkis,

I think you can use addn-hosts for name<=>IP address mapping and use
dhcp-hostsfile just for mac address assignment to existing pair. But it
prevents ability to create one file the other one, because primary data
are split into two files. I guess creation of addn-hosts from dhcp-hosts
by a script is the best solution available. I don't know about any way
just with one line per host.

Perhaps a flag could be added to dhcp-range, requesting also addition of
dhcp-hosts to static dns. Would it help if those hosts were assigned
infinite TTL to add permanent hostnames for them, similar to addn-hosts
record? I guess it would not hurt having permanent names on permanent
leases.

Cheers,
Petr

On 10/3/21 10:21, Alkis Georgopoulos wrote:
 > Hi, I'm using a dhcp-hostsfile with lines like the following:
 >>
 > b8:27:eb:c4:a5:4a,set:lab1,192.168.67.100,rpi
 >>
 > When that client boots, I can run `host rpi localhost` and dnsmasq
 > tells me its IP.
 > But when that client is offline, dnsmasq replies "Host rpi not found:
 > 3(NXDOMAIN)"
 >>
 > Is there any way for dnsmasq to put all the dhcp-hosts into its DNS
 > view even when these clients are offline?
 > Otherwise I guess I could write a bash script that converts a
 > dhcp-hosts file into an addn-hosts file with lines like:
 >>
 > 192.168.67.100 rpi
 >>
 > Please Cc me as I'm not in the list.
 >>
 > Thank you,
 > Alkis Georgopoulos
 >>
 > _______________________________________________
 > Dnsmasq-discuss mailing list
 > Dnsmasq-discuss at lists.thekelleys.org.uk
 > https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
 >>





More information about the Dnsmasq-discuss mailing list