networking & /etc/host
Robert Marcano
robert at marcanoonline.com
Fri Feb 20 12:39:31 UTC 2004
On Fri, 2004-02-20 at 05:46, Nigel Wade wrote:
> Philip wrote:
> > Hey,
> >
> > If I'm not mistaken, when logging into my desktop I should be logged in
> > to the "local host", at least that's what it used to do. I'm set up on a
> > LAN (simple NetGear router on top of broad band) and when I log in to my
> > desktop I'm actually logged in to what fedora calls "dhcppc4". As the
> > login proceeds I get an error:
> >
> > "Could not look up Internet address for dhcppc4. This will prevent GNOME
> > from operating correctly. It may be possible to correct the problem by
> > adding dhcppc4 to the file /etc/hosts"
> >
> > - however the login does succeed, though after an unusually long time.
> > I'm guessing that I missed some step in configuring my wireless
> > connection (I just re-installed on new hardware) and fedora gets
> > confused and tries to log in to the router or something. Has anyone seen
> > this before?? Any help would be great as I am far from proficient at
> > networking with fedora.
> >
> > - Phil
> >
> >
>
> My guess would be that your router is operating as a DHCP server and your PC
> is getting it's network address, hostname, DNS and other settings from it.
> But, it's not operating as a DNS server for your domain so when you login to
> the PC it's unable to resolve the hostname via DNS.
>
> A simple solution is to add fixed entries for all DHCP assigned hostnames
> into /etc/hosts on each machine. A complicated alternative is to set up a
> DNS server for your domain.
If you look at the file /etc/sysconfig/network-scripts/network-functions
you will be able to locate this function:
need_hostname ()
{
CHECK_HOSTNAME=`hostname`
if [ "$CHECK_HOSTNAME" = "(none)" -o "$CHECK_HOSTNAME" = "localhost" -o \
"$CHECK_HOSTNAME" = "localhost.localdomain" ]; then
return 0
else
return 1
fi
}
so if you set a different hostname on your network configuration file
/etc/sysconfig/network different to localhost or localhost.localdomain,
need_hostname will return 0 and the DHCP configuration script will not
override your hostname. Remember to add this custom hostname to you
/etc/hosts file
>
> I'd recommend the former solution.
>
> --
> Nigel Wade
More information about the users
mailing list