AWS instance after machine hostname change, the server loose connection after while


Hi all,

OS: SLES15 Server: EC2 with Load Balancer and Auto Scaling

After changing the hostname as "sudo hostnamectl set-hostname", the server loose connection after a while.

Any ideas how to make it stable? Thank you

1 Answer

Hostname can be made permanent with below steps:

  1. Set hostname $ sudo hostnamectl set-hostname new-hostname

$ sudo vi /etc/hosts

Find the localhost string and append the new hostname. localhost

Save and exit

  1. Confirm the change in hostname:

$ hostnamectl

Please refer:

answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions