[Dnsmasq-discuss] The simplest setup to preserve IPs

xerces8 xerces8 at butn.net
Tue Apr 1 16:59:15 BST 2008


This is what I do :

 - nothing in in /etc/hosts (except the usual localhost stuff)
 - lines in /etc/dnsmasq.conf:
dhcp-host=hostname,<address>

Example:
dhcp-host=johny,192.168.2.40
dhcp-host=blaster,192.168.2.41
etc...

My whole dnsmaq.conf:

# filter what we send upstream
domain-needed
bogus-priv
filterwin2k
localise-queries

# allow /etc/hosts and dhcp lookups via *.lan
local=/lan/
domain=lan
expand-hosts
no-negcache
resolv-file=/tmp/resolv.conf.auto

# enable dhcp (start,end,netmask,leasetime)
dhcp-authoritative
dhcp-leasefile=/tmp/dhcp.leases

read-ethers

# local name to IP mapping
dhcp-host=host1,192.168.100.30
dhcp-host=box2,192.168.100.31

Regards,
David







-----Original Message-----
From: Michal Sawicz <michal at sawicz.net>
To: dnsmasq-discuss at lists.thekelleys.org.uk
Date: Tue, 01 Apr 2008 17:05:38 +0200
Subject: [Dnsmasq-discuss] The simplest setup to preserve IPs

> Hi, I'm trying to get dnsmasq to give IPs assigned in /etc/hosts based
> on hostname from the dhcp request, my config is as follows:
> 
> domain-needed
> bogus-priv
> filterwin2k
> listen-address=192.168.0.1
> bind-interfaces
> expand-hosts
> domain=sawicz.net
> dhcp-range=192.168.0.2,192.168.0.50,12h
> dhcp-option=42,0.0.0.0
> 
> Based on that setup I thought that all the machines reporting a known
> hostname in the dhcp request would get the IP assigned to it
> in /etc/hosts file regardless of their IP (and, ideally, of the IP being
> leased - so that I'd be able to use either of my network ifaces).
> 
> Unfortunately it doesn't work like that for all my hosts - it does for
> those that are windows based, and not for the others.
> 
> For the others it assigns an IP from the dhcp-range and complains about
> not being able to assign the hostname, because it's present
> in /etc/hosts and has different IP assigned.
> 
> Am I missing something?
> 
> -- 
> Michal Sawicz <michal at sawicz.net>





More information about the Dnsmasq-discuss mailing list