[Dnsmasq-discuss] way to inject static host wireguard ip into dnsmasq.leases untill dhcp renewal

Simon Kelley simon at thekelleys.org.uk
Thu Mar 5 22:24:18 GMT 2020


On 04/03/2020 18:54, Jelle de Jong wrote:
> Hello everybody,
> 
> I have a setup with wireguard vpn clients that sadly need a static IP.
> 
> I got a script running to detect if the host is connected.
> 
> I want to tell dnsmasq the IP of the host so I can use the dns resolve
> of dnsmasq as kind of lease.
> 
> Then when dnsmasq provides a DHCP IP to this host it should overwrite
> the IP again that was manually injected in dnsmasq.
> 
> So I do want it to work as a IP lease but let it rotate between the last
> active IP (DHCP from dnsmasq or static IP from wireguard).
> 
> Any sane we of doing this?
> 


Would the simplest way be to tell dnsmasq to lease static address when
the host does DHCP? Make your script update /etc/hosts and send SIGHUP
to dnsmasq to re-load it.


Simon.



More information about the Dnsmasq-discuss mailing list