setting the hostname on ubuntu 18.04 / iRedMail

compdoc compdoc at hotrodpc.com
Wed Jan 9 19:28:22 UTC 2019


On 1/9/19 4:39 AM, robert rottermann wrote:
>
> On Debian/Ubuntu Linux, hostname is set in two 
> files:|/etc/hostname|and|/etc/hosts|.
>
>   * |/etc/hostname|: short hostname, not FQDN.
>
> |mx|
>
> and to to set etc hosts:
>
>   * |/etc/hosts|: static table lookup for hostnames.*Warning*: Please
>     list the FQDN hostname as first item.
>
> |# Part of file: /etc/hosts 127.0.0.1 mx.example.com mx localhost 
> localhost.localdomain |
>
> so what I did:
>
> in /etc/cloud/cloud.cfg
>
> I changed:
>
> # This will cause the set+update hostname module to not operate (if true)
> preserve_hostname: true
>
> in /etc/hostname:
>
> mx
>
>
> in /etc/hosts:
>
> 127.0.1.1 redcor.com redcor.com
> 127.0.0.1 mx.redcor.com localhost
>

mx is an unusal name for a mail server in my opinion, but I suppose it 
doesn't matter. I tend to use mail.domain.com, or main.domain.com

However, an 'mx' record needs to be set correctly with the business that 
hosts your domain name, such as Network Solutions or Godaddy, etc. It 
needs to point to the address of your mail server.

This is how I set my hosts file:

127.0.0.1 localhost

192.168.1.1 mail.domain.com mail

Use the real local ip address. I think "127.0.1.1" is placed there by 
network-manager, but not sure. I dont use it.

And your hostname is correct. Its just the single name of the server.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20190109/3407f99b/attachment.html>


More information about the ubuntu-users mailing list