Solved

Linux, hostname

Posted on 2013-12-19
3
333 Views
Last Modified: 2013-12-19
I am using RHEL 6.5

Recently I tried to chang emy hostname from xxclnt10 to xxclnt12x

From a command prompt, I go to

setup->network Configuration->DNS Configuration

                      âââââââ⤠DNS configuration ââââââââ
                      â                                 â
                      â                                 â
                      â Hostname        xxclnt12x______ â
                      â Primary DNS     x.x.x.x_____ â
                      â Secondary DNS   x.x.x.x_____ â
                      â Tertiary DNS    _______________ â
                      â DNS search path xxx.com_ â
                      â                                 â
                      â    ââââââ        ââââââââââ     â
                      â    â Ok â        â Cancel â     â
                      â    ââââââ        ââââââââââ     â
                      â                                 â
                      â                                 â
                      âââââââââââââââââââââââââââââââââââ


I save the entry and exit

I go back to make sure the hostname is set properly and it is

I do the following:

[root@xxclnt10 ~]# hostname
xxclnt10
[root@xxclnt10 ~]# service network restart
Shutting down interface eth3:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth3:  Determining if ip address 10.14.1.246 is already in use for device eth3...
                                                           [  OK  ]
[root@xxclnt10 ~]# hostname
xxclnt10
[root@xxclnt10 ~]#

Open in new window


I can ping in and out without problems, but I can not change the host name

1> Why is it doing this

2> How can I fix it

Thanks
0
Comment
Question by:Los Angeles1
3 Comments
 
LVL 2

Accepted Solution

by:
mcj2006 earned 500 total points
ID: 39730590
Try this
Hostname xxclnt12x

cat /etc/hosts 
change the line 127.0.0.1  xxclnt10 localhost.localdomain localhost
to                      127.0.0.1  xxclnt12x localhost.localdomain localhost

cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=xxclnt12x

service network restart

Open in new window

0
 

Author Comment

by:Los Angeles1
ID: 39730615
That actually did not work after the service network restart.

Had to reboot the machine, and then it worked.  Strange
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39730766
Don't add your hostname to the 127.0.0.1 entry! Never!

The network hostname must have its own unique IP in /etc/hosts!

And don't confuse the network hostname and the OS hostname.

The OS hostname is set via /etc/init.d/boot.localnet or /etc/init.d/rc.inet1 (by reading e.g. /etc/HOSTNAME or /etc/hostname, depending on the OS, and issuing the "hostname" command), while the network hostname(s) is/are the names associated with the IP address(es) of the machine's network interface(s) in /etc/hosts.

What worked regarding the above issue is rebooting, not messing around with /etc/hosts.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now