<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="moz-cite-prefix">On 1/9/19 4:39 AM, robert rottermann
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:f9b24e1c-15a7-0c89-c332-07eb3a9e9547@redcor.ch">
<p style="margin-bottom: 4px; padding: 0px; font-size: 17px;

line-height: 24px; color: rgb(0, 0, 0); font-family:
"PT
 Sans", Georgia, Palatino, serif; font-style:
normal;
 font-variant-ligatures: normal; font-variant-caps:
normal;
 font-weight: 400; letter-spacing: normal; orphans:
2; text-align:
 start; text-indent: 0px; text-transform:
none; white-space:
 normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width:
 0px; text-decoration-style:
initial; text-decoration-color:
 initial;">On Debian/Ubuntu
Linux, hostname is set in two files:<span> </span><code
style="font-family: Consolas, Monaco, "Andale
Mono",
 monospace; line-height: 25px; font-size:
14px; background:
 rgb(245, 245, 245); border: 1px solid
rgb(204, 204, 204);
 border-radius: 2px; padding: 1px 5px;
overflow-wrap: normal;">/etc/hostname</code><span> </span>and<span> </span><code
style="font-family: Consolas, Monaco, "Andale
Mono",
 monospace; line-height: 25px; font-size:
14px; background:
 rgb(245, 245, 245); border: 1px solid
rgb(204, 204, 204);
 border-radius: 2px; padding: 1px 5px;
overflow-wrap: normal;">/etc/hosts</code>.</p>
<ul style="padding-left: 30px; margin: 0px; font-size: 17px;

line-height: 24px; color: rgb(0, 0, 0); font-family:
"PT
 Sans", Georgia, Palatino, serif; font-style:
normal;
 font-variant-ligatures: normal; font-variant-caps:
normal;
 font-weight: 400; letter-spacing: normal; orphans:
2; text-align:
 start; text-indent: 0px; text-transform:
none; white-space:
 normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width:
 0px; text-decoration-style:
initial; text-decoration-color:
 initial;">
<li style="line-height: 26px;"><code style="font-family:
Consolas,
 Monaco, "Andale Mono", monospace;
line-height: 25px;
 font-size: 14px; background:
rgb(245, 245, 245); border: 1px
 solid rgb(204, 204,
204); border-radius: 2px; padding: 1px
 5px;
overflow-wrap: normal;">/etc/hostname</code>: short
hostname, not FQDN.</li>
</ul>
<pre style="padding: 5px 10px; white-space: pre-wrap; background: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 2px; overflow-wrap: normal; font-size: 14px; line-height: 25px; margin-left: 30px; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><code style="font-family: Consolas, Monaco, "Andale Mono", monospace; line-height: 25px; font-size: 14px; background: rgb(245, 245, 245); border: 0px; border-radius: 2px; padding: 5px 10px 5px 0px; overflow-wrap: normal; margin: 0px;">mx</code></pre>
<p>and to to set etc hosts:<br>
</p>
<ul style="padding-left: 30px; margin: 0px; font-size: 17px;

line-height: 24px; color: rgb(0, 0, 0); font-family:
"PT
 Sans", Georgia, Palatino, serif; font-style:
normal;
 font-variant-ligatures: normal; font-variant-caps:
normal;
 font-weight: 400; letter-spacing: normal; orphans:
2; text-align:
 start; text-indent: 0px; text-transform:
none; white-space:
 normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width:
 0px; text-decoration-style:
initial; text-decoration-color:
 initial;">
<li style="line-height: 26px;"><code style="font-family:
Consolas,
 Monaco, "Andale Mono", monospace;
line-height: 25px;
 font-size: 14px; background:
rgb(245, 245, 245); border: 1px
 solid rgb(204, 204,
204); border-radius: 2px; padding: 1px
 5px;
overflow-wrap: normal;">/etc/hosts</code>: static table
lookup for hostnames.<span> </span><strong>Warning</strong>:
Please list the FQDN hostname as first item.</li>
</ul>
<pre style="padding: 5px 10px; white-space: pre-wrap; background: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 2px; overflow-wrap: normal; font-size: 14px; line-height: 25px; margin-left: 30px; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><code style="font-family: Consolas, Monaco, "Andale Mono", monospace; line-height: 25px; font-size: 14px; background: rgb(245, 245, 245); border: 0px; border-radius: 2px; padding: 5px 10px 5px 0px; overflow-wrap: normal; margin: 0px;"># Part of file: /etc/hosts
127.0.0.1 mx.example.com mx localhost localhost.localdomain
</code></pre>
<br class="Apple-interchange-newline">
<p>so what I did:</p>
<p>in /etc/cloud/cloud.cfg</p>
<p>I changed:</p>
<p># This will cause the set+update hostname module to not operate
(if true)<br>
preserve_hostname: true</p>
<p>in /etc/hostname:</p>
<p>mx</p>
<p><br>
</p>
<p>in /etc/hosts:<br>
</p>
<p>127.0.1.1 redcor.com redcor.com<br>
127.0.0.1 mx.redcor.com localhost<br>
</p>
</blockquote>
<p><br>
</p>
<p>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</p>
<p>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. <br>
</p>
<p>This is how I set my hosts file:</p>
<p>127.0.0.1 localhost</p>
<p>192.168.1.1 mail.domain.com mail</p>
<p>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. <br>
</p>
<p>And your hostname is correct. Its just the single name of the
server.</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>