How to change hostname in Ubuntu

change hostname in ubuntu server, change hostname in ubuntu permanently, change hostname in ubuntu, how to change hostname in ubuntu, ubuntu change hostname

Are you looking for changing the hostname in Ubuntu server. So here is the solution to change hostname in ubuntu server.

We need to make a entries in two files as below.

1. vi /etc/hosts
192.168.2.1    hostname.learnitguide.net     hostname
Replace "hostname" with your server hostname and also "learnitguide.net" with your domain name.

2. vi /etc/hostname
hostname.learnitguide.net
Replace the content with your hostname and domain name.

After doing the changes, run any of these command or reboot the server for the changes to take effect.
sudo service hostname restart
or
cat /etc/hostname > /proc/sys/kernel/hostname
 change hostname in ubuntu server, change hostname in ubuntu permanently, change hostname in ubuntu commandline, how to change hostname in ubuntu, how do we change ubuntu hostname, ubuntu linux change hostname
August 08, 2016

Post a Comment

[disqus][facebook][blogger]

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget