Hii buddies, in this post let we see how to change and display the host name in the linux systems in different ways.
Generally we see the host name of linux
system in the terminal window, like username@hostname:~$
To display the hostname, domain name in
the terminal type the below commands
$hostname
$domainname
For Debian based Linux and Open SuSe Distribution users:
Various other commands for display and
change hostname,
- To display hostname
#sysctl kernel.hostname
- To change hostname temporarily use the following sysntax
1. $hostname technoyouth10
So the hostname will be now technoyouth10 (check it with by typing $hostname)
So the hostname will be now technoyouth10 (check it with by typing $hostname)
2. #sysctl kernel.hostname=New_host_name
3. You can edit the file
/proc/sys/kernel/hostname to change hostname temporarily
- To change the hostname permanently use the following procedure
- Open the hostname or HOSTNAME file in etc directory
$sudo vi /etc/hostname
2.Edit the file with new
hostname
technoyouth10
3.press escape and wq (wq for saving
the file)
4.then save the settings(without
rebooting) by typing the following command
$sudo service network restart (or) $sudo /etc/init.d/networking restart
For Fedora and Red Hat Linux users:
Edit the /etc/sysconfig/network file by
using following command
- $sudo /ect/sysconfig/network
- type the new hostname
- then save the settings by typing the following command$service network restart
No comments:
Post a Comment