DHCP and DNS configuration problem

Denys Vlasenko vda.linux at googlemail.com
Tue Jul 7 12:39:37 UTC 2009


On Tue, Jul 7, 2009 at 2:11 PM, Dach Miroslaw<miroslaw.dach at psi.ch> wrote:
> I start first dhcpd:
>
> MIPS# udhcpd /var/udhcpd.conf
>
> where /var/udhcpd.conf contains:
>
> interface eth0
> start 192.168.2.100
> end 192.168.2.200
> opt subnet 255.255.255.0
> opt router 192.168.2.1
> opt dns 192.168.2.1
> option lease 946080000
>
> #---------
>
> Next I start the dnsd
>
> MIPS# /usr/sbin/dnsd -c /var/dnsd.conf -i 192.168.2.1
>
> where /var/dnsd.conf contains:
> thebox 192.168.2.1
>
> Next I connect the node which is configured to get the IP address from
> the DHCP server.
>
> Just after I type:
> MIPS# dumpleases -a
> MIPS# Mac Address       IP-Address      Expires at
> MIPS# 00:03:75:7a:24:de 192.168.2.100   Sat Dec 25 01:00:00 1999
> MIPS# date
> MIPS# Tue Jul  7 13:54:50 CEST 2009
>
> I get the IP address as expected.
>
> The Expiration time is however wrong but it probably does not matter so much.

This is fixed in 1.14.x


> When I refer to my node (192.168.2.100) by name
> I get:
> MIPS# ping MY-TEST-BOX
> MIPS# ping: bad address 'MY-TEST-BOX'

Why, in your opinion, this should work?

> MIPS# ping 192.168.2.100
> MIPS# 192.168.2.100 is alive!
>
> The name is sent by the node connected with DHCP option 12.

Aha. I see. Your DHCP _client_ sends its hostname
to the DHCP server. Prior to 1.14.x, udhcpd did not use
this info at all, and in 1.14.x it is only used in lease table
(hostnames are shown if they are known),
but they are not stored anywhere else.

{ Oh no, I see a small bug there }

> Does anybody have an idea how to configure properly the DNS together with DHCP
> servers.

Crude solution is to switch to 1.14.2, run dumpleases,
parse its output and insert found hostnames into dnsd
config, then restart dnsd.

Proper solution is to teach udhcpd to optionally run a script
each time someone gets a new lease.

I don't know how well tested dnsd is. Please report bugs
if you see any.
--
vda


More information about the busybox mailing list