Assigning Static HostName to EC2 Instances

Hi Friends,

Below are the Steps to assign a Static hostname to EC2 Instances:

  1. Open the cloud.cfg file located at vi /etc/cloud/cloud.cfg
  2. Edit the file with the parameter preserve_hostname: true at the end of the file. 
  3. Open the hostname file(vi /etc/hostname) and delete the existing hostname and enter a new hostname you desired.
  4. Open the hosts file(vi /etc/hosts) and add the entry with the current IP address and above entered new hostname.
  5. To reflect the changes, one must run the init 6 command  and re-login to the session.
  6. Now, we can see that hostname is changed successfully.
           
           

Comments

Popular posts from this blog

Ms-Office-2016 Activator for free

Private Subnet Internet access in AWS.

How to check if your online account is hacked?