How to change the hostname of your Virtual Compute Nodes

How to change the hostname of your Virtual Compute Nodes

Change Virtual Compute Nodes Hostname
Please follow the below steps to change the hostname of your Virtual Compute Node.
Step 1: Login
Login to your Virtual Compute Node as a root user.
Step 2: Check Hostname
To check the current hostname of your server, run the command
hostname
To change the hostname of your server, type new name followed by hostname
hostname new-name
Step 3: Edit the network configuration file
For CentOS Change the hostname under the path /etc/sysconfig/network
vi /etc/sysconfig/network
Edit the content of the file so that it looks like this
HOSTNAME=new-name
Ubuntu/Debian Next, edit the /etc/hostname file and update hostname:
vi /etc/hostname
Step 4: Edit the hosts file
Edit the /etc/hosts file and update your old-host-name:
vi /etc/hosts
Now save and exit the file.
Step 5: Save Hostname permanently
Immediately after executing the previous command, the hostname is changed, but the change will last only until the next reboot. To permanently change the hostname, the next step is to run the following command in your terminal
cd /etc/one-context.d/
This will take you inside the directory one-context.d List the contents of the directory by running the following command,
ls -la
You will see the following result
drwxr-xr-x  2 root root 4096 Oct 26 19:48 .
drwxr-xr-x 72 root root 4096 Jan 21 15:04 ..
-rwxr-xr-x  1 root root 4433 Jan 15  2015 00-network
-rwxr-xr-x  1 root root 1991 Jan 15  2015 01-dns
-rwxr-xr-x  1 root root 1720 Jul 12  2016 02-ssh_public_key
-rwxr-xr-x  1 root root   28 Jan 15  2015 03-selinux-ssh
-rwxr-xr-x  1 root root   15 Jan 15  2015 04-mount-swap
-rwxr-xr-x  1 root root  614 Jan 15  2015 05-hostname
-rwxr-xr-x  1 root root  297 Jan 15  2015 99-execute-scripts
We need to move the directory 05-hostname to root folder. To execute this run the following command in the terminal.
mv 05-hostname /root/
Now your hostname is changed permanently.
    • Related Articles

    • How to view Event & Audit log reports of your Virtual Compute Nodes ?

       View your Virtual Compute Nodes Activity Logs E2E Networks’ customers can access their event and audit logs from their ‘MyAccount’ portal. Event Log An Event log is a record of all the operations performed on your Virtual Compute Nodes/Backups such ...
    • Virtual Compute Node Management Control Panel

      Virtual Compute Node Management Once you have created a Virtual Compute Node, you can access and manage your virtual compute nodes from My Account Portal dashboard features. Go to your E2E Networks ‘My Account’ portal to access the dashboard. The ...
    • How to create a new Virtual Compute Node

      E2E Networks Virtual Compute Nodes This tutorial will walk you through creating and accessing your first Virtual Compute Nodes Follow the process to create a single or multiple Virtual Compute Nodes. STEP 1: Logging into E2E Networks 'My Account' ...
    • How to create & manage your Virtual Compute Node Image?

      Virtual Compute Node Image A Virtual Compute Node Image is a template to create new instances. You can create your own images from running instances with an operating system along with the software and patches installed on them such as databases, ...
    • I have a new compute node from E2E. What do i do now ?

      Congratualtions. You have a new instance from e2enetworks.com. This article would help in getting started with the new instance and help you in doing first time config of your box 1. Access your box For improved security and also to negate ...