Hostname for Virtualmin server on AWS

Hi,

My Virtualmin server on AWS EC2 is reporting hostname as:

$ hostname
ip-172-31-37-191.ec2.internal

but in /etc/hosts I have:

[centos@ip-172-31-37-191 ~]$ more /etc/hosts
127.0.0.1   killjoy.responsiveny.com localhost localhost.localdomain localhost4 localhost4.localdomain4
::1   

As a result, some email "from" are looking like this:

Mar  2 19:14:19 ip-172-31-37-191 postfix/qmgr[1796]: 6438D8A8E2E: from=<example@ip-172-31-37-191.ec2.internal>, size=1003, nrcpt=1 (queue active)

What is the proper way to correct the FQDN of this server?

Status: 
Closed (fixed)

Comments

Howdy -- you can set the hostname in Webmin -> Networking -> Network Configuration -> Hostname and DNS Client.

When setting that, make sure that the "Update hostname in host addresses if changed" option is selected.

Also, you'd want to review afterwards that the new hostname is listed on the "mydestination" line of your /etc/postfix/main.cf file.

In that case, you may just want to manually verify that /etc/hosts contains an entry with your server's primary IP address (usually the one on "eth0"), along with your updated hostname.

It didn't make the change in /etc/hosts. I'll just go ahead and add it manually. Postfix is set to use hostname for outbound email domain so I shouldn't need to manually edit main.cf.

you should be able to close this now

Automatically closed -- issue fixed for 2 weeks with no activity.

Welshman's picture
Submitted by Welshman on Mon, 03/16/2015 - 17:56

Make sure you setup your FQDN before installing VM, you are warned at ./install.sh

It will save you a lot of bother I believe it says.