Created
November 6, 2014 22:08
-
-
Save fluxrad/7ec6b573e9f496d2fffe to your computer and use it in GitHub Desktop.
Update hostname on an AWS instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fix an EC2 instance's hostname. | |
echo "ip-$(echo $(curl -s http://169.254.169.254/latest/meta-data/local-ipv4 | tr '.' '-'))" | sudo tee /etc/hostname | sudo xargs hostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment