Solved

Linux, hostname

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

910 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

22 Experts available now in Live!

Get 1:1 Help Now