Subject: Re: No nameservers configured when using DHCP/dhclient
To: None <email@example.com>
From: Lee W <firstname.lastname@example.org>
Date: 05/19/2003 23:42:27
Robert Elz wrote:
> Date: Sun, 18 May 2003 19:22:03 -0400
> From: "Steven M. Bellovin" <email@example.com>
> Message-ID: <20030518232204.15EE57B4D@berkshire.research.att.com>
> To debug the dhclient script, edit it (/sbin/dhclient-script) and right
> near the start (but after the #! line obviously) add ...
> exec >> /tmp/dhclient-debug 2>&1
> echo "======================"
> echo "$# args: $@"
> set -x
> and then run dhclient normally, and after it has done, examine the
> debug file (/tmp/dhclient-debug - obviously you can put it wherever
> you like).
> This, along with examination of the dhclient-script (after you have
> the output, so you can easily see what is actually being done, and
> why) will usually allow any problems to be easily detected.
Thanks for your help everyone, I think I have cracked (sorry hacked) it.
It seems as the dhclient-script was at fault:-
# $NetBSD: dhclient-script,v 1.4 2002/04/10 10:11:41 enami Exp $
SIGNATURE="# Created by dhclient at: "
echo "MAKING RESOLV.CONF"
if [ \( ! -z "$new_domain_name" \) -a \
\( ! -z "$new_domain_name_servers" \) ]; then
if [ -f $RESOLV ]
while read line; do
case $line in
mv $RESOLV $RESOLV.save
echo "MOVED RESOLV.CONF.SAVE";;
done < $RESOLV
fi <--- Moved from Below
echo "$SIGNATURE$(date)" > $RESOLV
if [ ! -z "$new_domain_name" ]
echo search $new_domain_name >> $RESOLV
for nameserver in $new_domain_name_servers; do
echo nameserver $nameserver
done >> $RESOLV
#fi <--- Commented out
What I did was move the code for creating the resolv.conf file outside
of the checks for length of $new_domain_name & $new_domain_name_servers.
Consequently this allowed the resolv.conf file to be created.
Can anyone tell if what I have done will cause me any future trouble?
I would hate to think that I have compromised my shiny new install.