[Dnsmasq-discuss] Problem assigning static IP

Simon Kelley simon at thekelleys.org.uk
Wed Mar 22 17:24:44 GMT 2006

Mircea Bardac wrote:
> I've been struggling ever since I've installed dnsmasq to make it assign 
> statically some IP addresses + names based on the MAC addresses (for several 
> computers). I must be missing something in this process, since everything 
> seems to be ok - any help would be appreciated.
> My config file looks like this:
> # cat /etc/dnsmasq.conf.my
> domain-needed
> bogus-priv
> interface=eth0
> bind-interfaces
> expand-hosts
> domain=home.bardac.net
> dhcp-range=,,2h
> dhcp-host=00:0f:ea:fd:72:85,,aquarium
> # cat /etc/hosts
> #<ip-address>   <hostname.domain.org>   <hostname>
>               localhost.localdomain   localhost
>             server.home.bardac.net  server
>             aquarium.home.bardac.net        aquarium
> My machine is named "aquarium".
> me at aquarium # dhcpcd -k
> me at aquarium # dhcpcd
> outputs on the server
> # dnsmasq -C /etc/dnsmasq.conf.my -d
> dnsmasq: started, version 2.27 cachesize 150
> dnsmasq: compile time options: IPv6 GNU-getopt RTNetlink ISC-leasefile no-DBus 
> no-I18N
> dnsmasq: DHCP, IP range --, lease time 2h
> dnsmasq: read /etc/hosts - 15 addresses
> dnsmasq: reading /etc/resolv.conf
> dnsmasq: using nameserver
> dnsmasq: using nameserver
> dnsmasq: DHCPRELEASE(eth0) 00:0f:ea:fd:72:85
> dnsmasq: DHCPDISCOVER(eth0) 00:0f:ea:fd:72:85
> dnsmasq: DHCPOFFER(eth0) 00:0f:ea:fd:72:85
> dnsmasq: DHCPREQUEST(eth0) 00:0f:ea:fd:72:85
> dnsmasq: DHCPACK(eth0) 00:0f:ea:fd:72:85 aquarium
> dnsmasq: not giving name aquarium.home.bardac.net to the DHCP lease of 
> because the name exists in /etc/hosts with address
> dnsmasq: not giving name aquarium to the DHCP lease of because 
> the name exists in /etc/hosts with address
> Is there any option I should be enabling... or... maybe a typo up there... or 
> something else... I actually ran of ideas trying to figure this out. The 
> above example is the simplest case in which it doesn't work. 

Has the address be leased to another MAC address? The place
to check is /var/lib/misc/dnsmasq.leases. If that has happened, dnsmasq
will not be able to give the address out to another machine, and will
allocate an address out of the pool instead.

If you want to make changes to this file, (it's not normally necessary)
stop dnsmasq first, otherwise it will overwrite any changes you make.



> ------------------------------------------------------------------------
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

More information about the Dnsmasq-discuss mailing list