Skip to content

Instantly share code, notes, and snippets.

@wbbradley
Last active May 16, 2017 20:08
Show Gist options
  • Save wbbradley/66d818c7513d6d35dc59f21c5d83f6f6 to your computer and use it in GitHub Desktop.
Save wbbradley/66d818c7513d6d35dc59f21c5d83f6f6 to your computer and use it in GitHub Desktop.
put the private ip into /etc/hosts
# Run this after your AMI comes online
private_hostname=ip-$(curl http://169.254.169.254/latest/meta-data/local-ipv4 2>/dev/null | sed s/\\./-/g)
sudo su - -c "grep $private_hostname /etc/hosts || echo 127.0.0.1 $private_hostname >> /etc/hosts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment