
- Forum
- Operating Systems
- Linux
- Is this possible
Is this possible
This is a discussion on Is this possible within the Linux forums, part of the Operating Systems category; Is it possible to change the hostname of a Linux machine? If so what are the steps for doing this. ...
-
Is this possible
Is it possible to change the hostname of a Linux machine? If so what are the steps for doing this. If anyone provides me the idea I will also try this out.
-
You can change the hostname on any Linux system with the command ‘hostname‘.
The syntax is as below:
#hostname
Without any parameter it will output the current hostname of the system.
-
You can also use hostname on any Linux system with the command ‘hostname‘with parameters as below:
#hostname –fqd
The above would output the fully qualified domain name (or FQDN) of the system.
#hostname NEW_NAME
The above parameter option would set the hostname of the system to NEW_NAME.
-
If you use a Debian based Linux systems you can achieve Permanent hostname change as follows:
Debian based systems use the file /etc/hostname to read the hostname of the system at boot time and set it up using the init script /etc/init.d/hostname.sh
#cat /etc/hostname
debianadmin
So on a Debian based system we can edit the file /etc/hostname and change the name of the system and then run
/etc/init.d/hostname.sh startto make the change active. The hostname saved in this file (/etc/hostname) will be preserved on system reboot
-
Sponsored Ads
«
Symbolic Links
|
List all Files
»

Reply With Quote





