Static IP address and hostname to EC2 Instance - HaymonEdmur/DockerConfiguration GitHub Wiki

How to configure EC2 instance for static IP address and hostname

  • Get Elastic IP address
  • Use Route53 to add subdomain with IP address
  • Use hostnamectl to set static hostname
# hostnamectl set-hostname --static boston.com 
  • Edit following file /etc/cloud/cloud.cfg and add following line
   preserve_hostname: boston.com
  • Reboot or restart instance and use boston.com in ssh session
⚠️ **GitHub.com Fallback** ⚠️