+ Reply to Thread
Results 1 to 1 of 1
-
Administrator
- Join Date
- Mar 2010
- Posts
- 76
How to change the hostname on a running Linux system
How to change the hostname on a running Linux system
Method 1::
* Edit file /etc/sysconfig/network using your favourite editor. In my case is vi. So I’ll enter vi /etc/sysconfig/networkIf you are new to linux you probably will ask how to change the hostname of you computer. (A hostname is the unique name by which a network attached device is known on a network.) If you enter the wrong hostname during the installation, and you need to change the hostname, here is the solution:-
Code:/etc/sysconfig/network NETWORKING=yes HOSTNAME="xxxxxxx" GATEWAY="192.168.0.1" GATEWAYDEV="eth0" FORWARD_IPV4="yes"
Method 2::HTML Code:* Look for HOSTNAME=xxxxxx * Change the xxxx to the name you wish to set for your computer. (ex: HOSTNAME=cliffsupport.com) * Save the file and restart the xinetd service. (ex: type service xinetd restart in your shell) * Done! You have just changed your hostname in Linux platform
shell#hostnameOn any Linux system you can change its hostname with the command ‘hostname‘ Here are some quick usages of the command line hostname:
without any parameter it will output the current hostname of the system.
shell#hostname --fqd
shell#hostname NEW_NAMEPHP Code:it will output the fully qualified domain name (or FQDN) of the system.



:


LinkBack URL
About LinkBacks



Reply With Quote