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

richardvoigt at gmail.com richardvoigt at gmail.com
Wed Feb 18 01:50:08 GMT 2009


On Tue, Feb 17, 2009 at 10:47 PM, Hugo Heden <hugoheden at gmail.com> wrote:
> Good day all,
>
> On Fri, Feb 13, 2009 at 4:11 PM, RevRagnarok <DNSMasq at revragnarok.com> wrote:
>>
>> On Fri, Feb 13, 2009 at 9:55 AM, Chris G <cl at isbd.net> wrote:
>>>
>>> The problem is specific to my desktop machine (the xubuntu one) which
>>> is the one which is running dnsmasq.  When a web site is hung on my
>>> machine it's perfectly accessible from browsers on other machines on
>>> the same subnet/LAN and using the same router.  However IE within a
>>> virtual machine on my machine *can't* access the hung web site.
>>
>> I'm a little confused here. dnsmasq is more for servers than desktops. Of
>> course, you can run it where you like, but it looks like you have your
>> desktop acting as a DHCP server, possibly to itself. Or do you ensure the
>> machine is on all the time the other machines on the network need an IP? You
>> won't get any benefit (that I can think of) running dnsmasq on a stand-alone
>> desktop. The OS will cache DNS lookups very similarly on its own.
>>
>
> Sorry, I'd like to ask about this to clear it up: It shouldn't be a
> problem letting the host running dnsmasq acting as a DHCP-server to
> itself, right? (I was about to prepare a blog post/tutorial that
> describes and explains that setup.. so it'd be nice with a reality
> check.)
>
>  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.  There's no way around this
because in general dnsmasq runs on your gateway which by definition
has multiple interfaces.

>
> Thanks,
>
> Hugo Heden
>
> _______________________________________________
> 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