[Dnsmasq-discuss] prevent dnsmasq from releasing IPs

Hartmut Krafft hartmut at mail.ru
Wed Jan 27 15:05:32 GMT 2016


On Tue, 26 Jan 2016 21:31:29 +0000
Simon Kelley <simon at thekelleys.org.uk> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> 
> 
> On 26/01/16 14:56, Stefan Priebe - Profihost AG wrote:
> > 
> >> Am 26.01.2016 um 14:46 schrieb Simon Kelley
> >> <simon at thekelleys.org.uk>:
> >> 
> > 
> > 
> >>>> On 26/01/16 13:42, Stefan Priebe - Profihost AG wrote:
> > 
> >>>> 
> >>>> what about writing and sending kill 1 / HUP?
> > 
> > 
> > No. The only only way to make that work would be to
> > 
> > 1) Stop dnsmasq with SIGTERM 2) modify the leases file 3) restart
> > dnsmasq
> > 
> > 
> > in that
> > 
> >> Last idea isn't it possible to make the host static on add? If it
> >> is which file should I use to add the mac  hostname IP
> >> combination
> 
> 
> Add the hostname and IP in /etc/hosts, and add the MAC/hostname or
> MAC/IP as --dhcp-host configuration.
> 
> You can provide all three in --dhcp-host, that will ensure that only
> the specified MAC address gets that IP address BUT, the IP/name  will
> only exist in the DNS whilst the DHCP lease exists. If you want the
> hostname to always resolve, you have to put it in /etc/hosts or
> friend.

If you want to avoid shutting down dnsmasq you could use the
dhcp-hostsfile and addn-hosts directives (see manpage). You can
regenerate those files while dnsmasq is running and send a hangup
signal to the dnsmasq process which will cause them to be read and the
information updated.
I've made me a unified dhcp+hostsfile input file and a script to
generate both dhcp-hostsfile and addnhost from that because I found
that I preferred not to have to enter redundant data in two files (and
invariably ending up with contradictory entries).
You'll just have to devise a way to enter your information into those
files for your usecase.

Hartmut


> 
> 
> Cheers,
> 
> Simon.





More information about the Dnsmasq-discuss mailing list