[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Pump, dhchp, dns and dnsmasq



On Sat, 2011-02-05 at 15:34 +0000, T o n g wrote:
[...]
> - The dnsmasq can be used as both dhchp and dns server. This is
>   ideal for a home network. My question is, my router is
>   currently acting as both dhchp and dns server for the moment,
>   if I dedicate a box for dnsmasq as both dhchp and dns server,
>   how would clients on my local network know which server to use?
[...]

You'll have to disable DHCP on your router so only your new box responds
to DHCP requests. For DNS, the DHCP response can give the IP address of
the DNS for your clients to use. Add a line to /etc/dnsmasq.conf which
says "dhcp-option=6,0.0.0.0". (The 6 is the magic number for
'nameserver', and 0.0.0.0 means dnsmasq will use its own ip address in
the response to the client.)
	
[...]
> - When I said the dnsmasq is ideal for a home network, I meant
>   that I hope to be able to give a fixed dhcp lease to a client
>   that sends a particular name -- that way I just have to
>   maintain dnsmasq.conf file on the gateway box for local dhchp
>   and dns, and I don't have to fiddle around finding and
>   recording and entering the MAC addresses for each network card
>   on each machine, and fiddle with the router web interface. Have
>   you done something similar?
[...]

Why do you need to fiddle with the router web interface?

I went the MAC address route, adding a dhcp-host line in dnsmasq.conf
for each NIC. E.g. the entry for the machine I'm typing on is

dhcp-host=00:28:58:3A:EB:A1,192.168.2.20,computer2,infinite
          ^                 ^            ^         ^
          MAC               IP Address   hostname  lease time

That is the only per client config needed. The nice thing about using
dnsmasq as DHCP+DNS is that DNS can resolve these hostnames, e.g.
"ssh tixy@computer2" will work :-)


-- 
Tixy               ()  The ASCII Ribbon Campaign (www.asciiribbon.org)
                   /\  Against HTML e-mail and proprietary attachments


Reply to: