suggestion for dhcp hints

St.Purple purplehouse at
Fri Mar 22 07:33:41 PST 2002

Why not put just

source /etc/dhcpc/dhcpcd-$
$IPADDR        Neptune
in your hosts file.

This works for me.....


¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´St. Purple`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸

There is but a thin line between coincedence and fate

"Gregory Davis" <gdavis7 at> wrote in message
news:a7deoi$riq$1 at
> Hello there!  In the latest dhcp hint, the author has setup the hostname,
> but only makes a call to action for setting up the IP.  For instance,
> setting dhcp according to the hint, hostname -i returns garbage.  This is
> because the dynamically assigned IP is not included in the /etc/hosts
>  I do not know if that will cause any problems, but I like to do things
> the way.  So I played with the ethnet init script and came up with these
> inclusions thereto, one for the bottom of the start) case, and the other
> for the bottom of the stop) case.  Of course, these include my domain
> names, but users should replace them with his or her own.  Also, these
> inclusions get the IP address from dhcp's info file (is this a security
> risk?) so it is concurrent with the dynamically assigned IP from the dhcp
> server.  These inclusions also prevent against runaway additions to the
> /etc/hosts file by checking for previous additions using grep.
> Greg
> ## begin start) inclusion
>         if [ -z "`cat /etc/hosts | /bin/grep ""`" ]
>         then
>                 source /etc/dhcpc/dhcpcd-$
>                 echo "$IPADDR        Neptune" \
>                         | cat >> /etc/hosts
>         fi
>                 ;;
> ## end start) inclusion
> ## begin stop) inclusion
>         echo \
> "# Begin /etc/hosts (network card version)
>      localhost.localdomain   localhost
> #
> # below is dynamic IP address added by ethnet script
> #
> " \
>         | cat > /etc/hosts
> ## end stop) inclusion

Unsubscribe: send email to listar at
and put 'unsubscribe hints' in the subject header of the message

More information about the hints mailing list