Re: Pump, dhchp, dns and dnsmasq
On Mon, 2011-02-07 at 04:27 +0000, T o n g wrote:
> On Sat, 05 Feb 2011 20:19:43 +0000, Tixy wrote:
>
> > . . . 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 :-)
>
> Hmm, why it doesn't work for me. Here is my setting:
>
> dhcp-host=00:16:3e:00:00:01,kvm1,192.168.0.1,8h
> dhcp-host=00:16:3e:00:00:02,kvm2,192.168.0.2,8h
>
> On DNSmasq server (maroon):
>
> % /etc/init.d/dnsmasq restart
> Restarting DNS forwarder and DHCP server: dnsmasq.
>
> >From other boxes,
>
> $ dig kvm1 @maroon
>
> ; <<>> DiG 9.7.1-P2 <<>> kvm1 @maroon
> ;; global options: +cmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 41058
> ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
[...]
Had kvm1 got it's ip address by DHCP at this point? Dnsmasq doesn't
return results for machines until after its served out an address. (It's
a bit of a pain if you reboot the dnsmasq server because it doesn't
resolve clients until after they've rebooted. I suppose that's the
advantage of using the 'hosts' file on the dnsmasq server.)
I realise I also have 'expand-hosts' in my dnsmasq.conf (don't think
that is relevant to the current problem though, I believe it lets it
resolve 'kvm1.your-domain' as well as plain 'kvm1'.
BTW, DHCP traffic shows up in /var/log/daemon.log, which is useful for
seeing what goes on.
--
Tixy () The ASCII Ribbon Campaign (www.asciiribbon.org)
/\ Against HTML e-mail and proprietary attachments
Reply to: