[Dnsmasq-discuss] dnsmasq host being dhcp server to itself [WAS: Web hang ups after repeated access to one site - dnsmasq related?]

Hugo Heden hugoheden at gmail.com
Thu Feb 19 08:21:22 GMT 2009


Hi,

On Wed, Feb 18, 2009 at 2:50 AM, richardvoigt at gmail.com
<richardvoigt at gmail.com> wrote:
> On Tue, Feb 17, 2009 at 10:47 PM, Hugo Heden <hugoheden at gmail.com> wrote:

[snip]

>>  What I was thinking is having something like the following. All hosts
>> on the network are configured to use dhcp, *including* the host
>> running dnsmasq. All hosts are equal in that sense. And dnsmasq is the
>> dhcp server.. /etc/dnsmasq.conf could look like this:
>>
>> ---
>>  domain-needed
>>  bogus-priv
>>
>>  # Let dnsmasq ignore /etc/resolv.conf (because when using the dhcp
>>  # stuff, that file will be *output* from dnsmasq rather than input)
>>  no-resolv
>>
>>  # Upstream DNS server that dnsmasq will forward queries to (an
>>  # adsl modem perhaps):
>>  server=192.168.0.254
>>
>>  # /etc/hosts does not contain anything useful for our purposes.
>>  # Even for this host (the one running dnsmasq), we use
>>  # dhcp-host= instead, see below.
>>  no-hosts
>>
>>  ### DHCP stuff ###
>>  domain=lan
>>  dhcp-range=192.168.1.50,192.168.1.100,12h
>>
>>  # Some hosts will always get the same, "constant", IP address:
>>  dhcp-host=hostrunningdnsmasq,192.168.1.101,12h
>>  dhcp-host=somehost,192.168.1.70,12h
>>  dhcp-host=otherhost,192.168.1.71,12h
>>  dhcp-host=yetanotherhost,192.168.1.72,12h
>>
>>  # Tell dhcp clients what the gateway is (this overrides the
>>  # default which would have been the host running dnsmasq)
>>  dhcp-option=option:router,192.168.1.1
>>
>> ---
>>
>> No other configuration files needed -- on any host -- just let
>> everybody use dhcp. Super easy. But will this work?
>
> No.  dnsmasq determines which dhcp-range to use when giving out
> addresses from the IP address configured on the interface where the
> DHCP-REQUEST packet is received (or the interface address passed along
> by a dhcp-relay agent).  As you can see this cannot possibly work to
> assign addresses to the dnsmasq box.

Ah, I think I see what you mean..  the dhcp-range that dnsmasq picks
addresses from must be in the same subnet as the interface on which
the dhcp-request is received -- that's how dnsmasq determines what
dhcp-range to use (if there are more than one dhcp-range
specified)..(?). In essence, dnsmasq needs to have an IP address
before it can give out IP addresses, so the dnsmasq box cannot be a
dhcp client to itself..(?)

Thanks

Hugo Heden



More information about the Dnsmasq-discuss mailing list