Skip to content

Instantly share code, notes, and snippets.

@Kiran01bm
Created July 18, 2019 00:51
Show Gist options
  • Save Kiran01bm/d914abb7bba7daaf2dcbe41ae53ec2b1 to your computer and use it in GitHub Desktop.
Save Kiran01bm/d914abb7bba7daaf2dcbe41ae53ec2b1 to your computer and use it in GitHub Desktop.
Set Static hostname on EC2 RHEL
1. hostname - Before change
2. sudo hostnamectl set-hostname --static ip-xxx-xxx-xxx-xxx.us-east-2.compute.internal
3. Add "preserve_hostname: true" to /etc/cloud/cloud.cfg
4. Reboot
5. hostname - After change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment