Set Permanant hostname on AWS EC2 CentOS 7 server

On AWS EC2 when you boot, hostname set something like ip-172-31-41-172.eu-central-1.compute.internal

To chaneg this, run

Example

To disable change of hostname, run

Now reboot your server with