Solved

Linux, hostname

Posted on 2013-12-19
3
336 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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). …
Fine Tune your automatic Updates for Ubuntu / Debian
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

785 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