I used Rancher to create some new hosts. I had to reboot 1 of the hosts and I noticed that when I ssh’d back into the host, that it’s hostname was now the private dns name “ip-172-31-1-39.ec2.internal”
The OS of the host is CentOS 7 - CentOS Linux 7 x86_64 HVM EBS 1602-b7ee8a69-ee97-4a49-9e68-afaee216db2e-ami-d7e1d2bd.3 (ami-6d1c2007)
CentOS 7 does seem to have some reqs for persisting the hostname, the following gets it set correctly in EC2 -
sudo hostnamectl set-hostname --static “someservername”
Add “preserve_hostname: true” to the file “/etc/cloud/cloud.cfg”
Phillip