[BusyBox] dhcp

ssaguiar at brturbo.com.br ssaguiar at brturbo.com.br
Fri May 13 19:48:10 MDT 2005

Dear friends:

I am trying to make the busybox's dhcp client work but I am experimenting some problems.

The dhcp client picks the data for the resolv.conf file and creates it.
Even in this case, my Linux box can't find any address in internet. However it works for the ip.

If I try, by example, to ping www.google.com, I get the message : 

# ping: www.google.com: Unknown host

This happens for all domains, but if I ping by the ip, it ok.

My configuration files are below.

As I could not find any tutorial or manual about this dhcp client, I am trying to have some help from you.

The file default.script, I found in the busybox list.

Thanks very much for any help.

File /etc/nsswith.conf :

passwd:     files
shadow:     files
group:      files

hosts:      files dns

protocols:  files
rpc:        files
services:   files

File /etc/host.conf:

order hosts,bind
multi on

File /etc/resolv.conf (this file is generated on the fly by the dhcp client):

domain lan

File /etc/init.d/rcS :

#! /bin/sh

/bin/mount -a

/bin/hostname My-Linux

/bin/mount -o remount,rw /

ifconfig eth0

/sbin/udhcpc -n -q -s /usr/share/udhcpc/default.script

ifconfig lo


File /usr/share/udhcpc/default.script:

# Sample udhcpc renew script


[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"

/sbin/ifconfig $interface $ip $BROADCAST $NETMASK

if [ -n "$router" ]
        echo "deleting routers"
        while /sbin/route del default gw dev $interface
        do :

        for i in $router
                /sbin/route add default gw $i dev $interface metric $((metric++))

echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
for i in $dns
        echo adding dns $i
        echo nameserver $i >> $RESOLV_CONF

More information about the busybox mailing list