LinuxQuestions.org
Have you heard the LinuxQuestions.org Podcast?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 10-14-2009, 10:30 AM   #1
qwkfish
LQ Newbie
 
Registered: Jun 2009
Posts: 5
Thanked: 0
Hostname defined in file "network" changes after change to file "hosts"


[Log in to get rid of this advertisement]
A CentOS 5.3 server running a Xen virtual machine also running CentOS 5.3. The pertinent files are configured as follows:

/etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=system-wrk-1
GATEWAY=172.16.15.1

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

ip addr add 192.168.30.5/24 brd 192.168.30.255 dev eth0 label eth0:0

/etc/hosts

127.0.0.1 localhost
192.168.30.5 system-adm-1 adm-1 # alias eth0:0
192.168.20.5 system-wrk-1 wrk-1 # eth1 (relates to hostname)
## eth0 is DHCP obtaining an address of 172.16.25.2

command line prompt

guest@system-wrk-1

All is fine up until this point where a technician makes the following change to /etc/hosts:

127.0.0.1 localhost
192.168.30.5 system-adm-1 adm-1 # alias eth0:0
192.168.20.5 system-wrk-1 wrk-1 # eth1
172.16.25.2 system-hse-1 ## still DHCP but entered here

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

guest@system-hse-1

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.

Qwkfish
windows_xp_2003 qwkfish is offline  
Tag This Post ,
Reply With Quote
Old 10-14-2009, 12:01 PM   #2
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 973
Thanked: 0
Code:
hostname -f
what is the output?

otherwise do a
Code:
echo "system-wrk-1" > /etc/hostname
windows_98_nt_2000 odcheck is offline     Reply With Quote
Old 10-14-2009, 05:07 PM   #3
qwkfish
LQ Newbie
 
Registered: Jun 2009
Posts: 5
Thanked: 0

Original Poster
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.
windows_xp_2003 qwkfish is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 6 07-09-2008 05:58 PM
vfe NIC driver: "Add hostname for the NIC card into the /etc/hosts file???" FelixDzerzhinsk Solaris / OpenSolaris 5 06-09-2008 05:40 PM
"No root file system is defined" - During installation process of Ubuntu Trinric Linux - Newbie 6 05-20-2008 06:34 AM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 09:31 AM
"symbol __pthread_initialize, version GLIBC_2.0 not defined in file libpthread.so.0" citrus Linux - Software 6 01-06-2007 12:24 AM


All times are GMT -5. The time now is 07:27 PM.

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