How change permanently FQDN of ubuntu in AWS EC2, if possible

1

I need to install and configure Postfix for a mail server in my AWS (Amazon Web Services) EC2 instance, but it asks for FQDN and my FQDN is ip-XXX-XX-XX-XX.ec2.internal (where XXX-XX-XX-XX is the internal IP of the instance)

And as I will probably sometimes need to restore from a snapshot (I say restore from AMI that was created from a snapshot). I have to create a new instance with the AMI and as when I create a new instance it comes with a different internal IP. I guess that FQDN will change too to the new internal IP included on it.


So my Question is:
What I should input when it asks for FQDN of the machine when installing postfix or if possible, how can I change the FQDN to per example "myServer" or something else simple if when I create a new instance from AMI of a snapshot, FQDN becomes something like ip-XXX-XX-XX-XX.ec2.internal again?

DiogoSaraiva

Posted 2015-09-11T16:42:06.800

Reputation: 307

Answers

1

Use "cloud-init", while launching the instance. You can send the bash script, as user-data, which will set the (predefined) FQDN. You can use some simple name like "postfix.your.domain.com", instead using some cryptic name, you mentioned above. For documentation: cloud-init

x1b2j

Posted 2015-09-11T16:42:06.800

Reputation: 111