-   Linux - Networking (
-   -   Hostname change issues (

sfwalter 10-29-2004 03:20 PM

Hostname change issues

I'm new to linux networking so please exuse me, if this is a basic question.

I am a consultant and travel from client to client. When I went to a particular client, I noticed my hostname was changed to "", even though my /etc/sysconfig/network say its "localhost.localdomain".

Then when I logged in I got the gnome messaage saying "Could not look up internet address for

I fixed this problem, I believe by setting my /etc/hosts file to: localhost.localdomain localhost

First question is: Is this the right solution?

Second question is: If I go to another client's network do I have to keep updating the /etc/hosts file? Is there a better way?

thanks in advance, scott.

ugge 10-29-2004 04:50 PM

First lets take a look at why this happened to you. When you connected to this network you got an IP from their DHCP server, but in addition to that you also got sent a hostname to use.
In a file called ifcfg-eth0 (usually found in /etc/sysconfig/network directory) you have a line saying something about USEPEERDNS = Yes, this is what made your hostname change. Setting this to No would have made your linux ignore that hostname info from the DHCP.

I don't know exactly which file is making trouble for you here and now. You should not have to add the hostname in your hosts file. In this situation I would search the files in the /etc directory for instances of that hostname. As root user run the following command to do that.

grep -r 'vivare\.com' /etc/*
This would show any lines that contain the word along with what file it is in.
Post your findings here.

All times are GMT -5. The time now is 02:31 AM.