Teaching how to Update the hostname in your XUbuntu (16.0.4) Dev environment

I based these instructions from: http://askubuntu.com/questions/9540/how-do-i-change-the-computer-name

If, for whatever reason you need to change your hostname, as I had to, you need to edit the computer name in two files:

/etc/hostname

and

/etc/hosts

These will both need administrative access, so run

gksu gedit /path/to/file

Replace any instances of the existing computer name with your new one.

Note: If you don’t have gksu installed, you need to: sudo apt-get install gksu

When complete
run sudo service hostname restart or restart your computer and the name will have been changed.

For Fedora:

See: http://www.putorius.net/2013/09/how-to-change-machines-hostname-in.html

First: The “hostname” command.

You can use the hostname command to see the current host name of the system.

# hostname
bighat.putorius.net

You can also use the hostname command to change the host name of the machine.

# hostname smallhat.putorius.net

Then issue the hostname command again to see the changes.
# hostname
smallhat.putorius.net

This only makes a temporary or non-persistent change of hostname. 

Second: The /etc/sysconfig/network configuration file. (preferred method)

In order for the change to survive a reboot, or to make it persistent, you must change it in the /etc/sysconfig/network file.

Open the file in your favorite editor and change the following line to reflect your desired hostname.

HOSTNAME=newname.putorius.net

After making changing to the configuration file you need to restart the network service in order to read that file.

/etc/init.d/network restart

Advertisement

Author: Carlos Rodriguez Iturria

I am extremely passionate about people, technology and the most effective ways to connect the two by sharing my knowledge and experience. Working collaboratively with customers and partners inspires and excites me, especially when the outcome is noticeable valuable to a business and results in true innovation. I enjoy learning and teaching, as I recognise that this is a critical aspect of remaining at the forefront of technology in the modern era. Over the past 10+ years, I have developed and defined solutions that are reliable, secure and scalable, working closely with a diverse range of stakeholders. I enjoy leading engagements and am very active in the technical communities – both internal and external. I have stood out as a noticeable mentor running technology events across major cities in Australia and New Zealand, including various technology areas such as, Enterprise Integrations, API Management, Cloud Integration, IaaS and PaaS adoption, DevOps, Continuous Integration, Continuous Automation among others. In recent years, I have shaped my role and directed my capabilities towards educating and architecting benefits for customers using Oracle and AWS Cloud technologies. I get especially excited when I am able to position both as a way to exceed my customers’ expectations. I hold a bachelor degree in Computer Science and certifications in Oracle and AWS Solutions Architecture.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: