[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=192.168.0.20,192.168.0.40,2h
> dhcp-host=00:0f:ea:fd:72:85,192.168.0.2,aquarium
> 
> # cat /etc/hosts
> #<ip-address>   <hostname.domain.org>   <hostname>
> 127.0.0.1               localhost.localdomain   localhost
> 192.168.0.1             server.home.bardac.net  server
> 192.168.0.2             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 192.168.0.20 -- 192.168.0.40, lease time 2h
> dnsmasq: read /etc/hosts - 15 addresses
> dnsmasq: reading /etc/resolv.conf
> dnsmasq: using nameserver 193.231.236.25#53
> dnsmasq: using nameserver 193.231.236.30#53
> dnsmasq: DHCPRELEASE(eth0) 192.168.0.20 00:0f:ea:fd:72:85
> dnsmasq: DHCPDISCOVER(eth0) 00:0f:ea:fd:72:85
> dnsmasq: DHCPOFFER(eth0) 192.168.0.20 00:0f:ea:fd:72:85
> dnsmasq: DHCPREQUEST(eth0) 192.168.0.20 00:0f:ea:fd:72:85
> dnsmasq: DHCPACK(eth0) 192.168.0.20 00:0f:ea:fd:72:85 aquarium
> dnsmasq: not giving name aquarium.home.bardac.net to the DHCP lease of 
> 192.168.0.20 because the name exists in /etc/hosts with address 192.168.0.2
> dnsmasq: not giving name aquarium to the DHCP lease of 192.168.0.20 because 
> the name exists in /etc/hosts with address 192.168.0.2
> 
> 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 192.168.0.2 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.

HTH

Simon.


> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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