Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Linux, hostname

Posted on 2013-12-19
3
Medium Priority
?
343 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 2000 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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…
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…
Suggested Courses

772 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