Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-14-2009, 09:30 AM   #1
LQ Newbie
Registered: Jun 2009
Posts: 8

Rep: Reputation: 0
Hostname defined in file "network" changes after change to file "hosts"

A CentOS 5.3 server running a Xen virtual machine also running CentOS 5.3. The pertinent files are configured as follows:



/sbin/ifup-local (case statement for 'eth0')

ip addr add brd dev eth0 label eth0:0

/etc/hosts localhost system-adm-1 adm-1 # alias eth0:0 system-wrk-1 wrk-1 # eth1 (relates to hostname)
## eth0 is DHCP obtaining an address of

command line prompt


All is fine up until this point where a technician makes the following change to /etc/hosts: localhost system-adm-1 adm-1 # alias eth0:0 system-wrk-1 wrk-1 # eth1 system-hse-1 ## still DHCP but entered here

Now after a reboot of the system (virtual machine), the command line prompt comes back as:


If /etc/hosts is only a local DNS lookup, why doesn't the prompt adhere to the value set in /etc/sysconfig/network and why does it change to the new entry defined in /etc/hosts? Not only did it change names, it changed interfaces!

Your insight is greatly appreciated.

Old 10-14-2009, 11:01 AM   #2
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 30
hostname -f
what is the output?

otherwise do a
echo "system-wrk-1" > /etc/hostname
Old 10-14-2009, 04:07 PM   #3
LQ Newbie
Registered: Jun 2009
Posts: 8

Original Poster
Rep: Reputation: 0
This only occurs in the virtual machine

To answer odcheck, the return from hostname -f is system-hse-1. Populating /etc/hostname (not normally present by default in CentOS, is this a Debian thing?) changes nothing.

This would appear to be a bug in the Xen stuff. The virtual machine has CentOS 5.3 running on it just as the base physical machine does. Both system install sets are essentially the same. The condition only occurs on the virtual machine given the same setup. May have to go to the well (Citrix) on this one.


linux, networking

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I "cat" or "grep" a file to ignore lines starting with "#" ??? callagga Linux - Newbie 7 08-16-2013 06:58 AM
"No root file system is defined" - During installation process of Ubuntu Trinric Linux - Newbie 7 02-14-2011 12:44 PM
vfe NIC driver: "Add hostname for the NIC card into the /etc/hosts file???" gluesniffmonkey Solaris / OpenSolaris 5 06-09-2008 04:40 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
"symbol __pthread_initialize, version GLIBC_2.0 not defined in file" citrus Linux - Software 6 01-05-2007 11:24 PM

All times are GMT -5. The time now is 04:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration