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

Jelle de Jong jelledejong at powercraft.nl
Wed Mar 11 21:07:53 GMT 2020

Hi Simon,

On 2020-03-05 23:24, Simon Kelley wrote:
> 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.

If I reload dnsmasq with a SIGHUP every minute or five minutes will that 
not cause issues, then it will be solution.

Kind regards,

Jelle de Jong

More information about the Dnsmasq-discuss mailing list