LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Hostname change issues (https://www.linuxquestions.org/questions/linux-networking-3/hostname-change-issues-248841/)

sfwalter 10-29-2004 02:20 PM

Hostname change issues
 
Hi,

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 "plwstellant.vivare.com", 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 plwstellant.vivare.com.

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

127.0.0.1 localhost.localdomain localhost plwstellant.vivare.com


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 03: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 plwstellantvivare.com 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.
Code:

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


All times are GMT -5. The time now is 11:43 PM.