mydomain and myhostname

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

mydomain and myhostname

Christoph Pleger
Hello,

I have here two different postfix installations, one is postfix 2.11.3-1
from Debian 8, the other is postfix 3.1.0-3 from Ubuntu 16.04.
/etc/postfix/main.cf is the same on both machines, mydomain and
myhostname are not set in main.cf . When I call postconf, I get

mydomain = cs.uni-dortmund.de
myhostname = cloudhost177.cs.uni-dortmund.de

on the Debian machine, but

mydomain = localdomain
myhostname = cloudhost176.localdomain

on the Ubuntu machine.

What are the possible reasons for that? I cannot find out why the Debian
postfix finds the domain information, but the Ubuntu postfix does not.

Regards
   Christoph
Reply | Threaded
Open this post in threaded view
|

Re: mydomain and myhostname

Dominic Raferd


On 18 April 2017 at 16:35, Christoph Pleger <[hidden email]> wrote:
Hello,

I have here two different postfix installations, one is postfix 2.11.3-1 from Debian 8, the other is postfix 3.1.0-3 from Ubuntu 16.04. /etc/postfix/main.cf is the same on both machines, mydomain and myhostname are not set in main.cf . When I call postconf, I get

mydomain = cs.uni-dortmund.de
myhostname = cloudhost177.cs.uni-dortmund.de

on the Debian machine, but

mydomain = localdomain
myhostname = cloudhost176.localdomain

on the Ubuntu machine.

From http://www.postfix.org/postconf.5.html#myhostname: the default [for myhostname] is to use the fully-qualified domain name (FQDN) from gethostname(), or to use the non-FQDN result from gethostname() and append ".$mydomain"

- i.e. what you see when you type 'hostname' at the command line, which in turn is usually taken from the contents of /etc/hostname. And mydomain is by default derived from myhostname. If you update /etc/hostname you may also need to update /etc/hosts.
Reply | Threaded
Open this post in threaded view
|

Re: mydomain and myhostname

Wietse Venema
In reply to this post by Christoph Pleger
Christoph Pleger:

> Hello,
>
> I have here two different postfix installations, one is postfix 2.11.3-1
> from Debian 8, the other is postfix 3.1.0-3 from Ubuntu 16.04.
> /etc/postfix/main.cf is the same on both machines, mydomain and
> myhostname are not set in main.cf . When I call postconf, I get
>
> mydomain = cs.uni-dortmund.de
> myhostname = cloudhost177.cs.uni-dortmund.de
>
> on the Debian machine, but
>
> mydomain = localdomain
> myhostname = cloudhost176.localdomain
>
> on the Ubuntu machine.
>
> What are the possible reasons for that? I cannot find out why the Debian
> postfix finds the domain information, but the Ubuntu postfix does not.

'localdomain' is the Postfix built-in default domain name when the
machine name is not in 'host.domain' form.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: mydomain and myhostname

Christoph Pleger
In reply to this post by Dominic Raferd
Hello,

>> I have here two different postfix installations, one is postfix
>> 2.11.3-1
>> from Debian 8, the other is postfix 3.1.0-3 from Ubuntu 16.04.
>> /etc/postfix/
>> main.cf is the same on both machines, mydomain and myhostname are not
>> set
>> in main.cf . When I call postconf, I get
>>
>> mydomain = cs.uni-dortmund.de
>> myhostname = cloudhost177.cs.uni-dortmund.de
>>
>> on the Debian machine, but
>>
>> mydomain = localdomain
>> myhostname = cloudhost176.localdomain
>>
>> on the Ubuntu machine.
>
>
> From http://www.postfix.org/postconf.5.html#myhostname: the default
> [for
> myhostname] is to use the fully-qualified domain name (FQDN) from
> gethostname(), or to use the non-FQDN result from gethostname() and
> append
> ".$mydomain"
>
> - i.e. what you see when you type 'hostname' at the command line, which
> in
> turn is usually taken from the contents of /etc/hostname. And mydomain
> is
> by default derived from myhostname. If you update /etc/hostname you may
> also need to update /etc/hosts.

The format of /etc/hostname and /etc/hosts is exactly the same on the
two machines, only the actual values differ. /etc/hostname contains the
non-FQDN name, /etc/hosts contains first the FQDN and then the non-FQDN.

Regards
   Christoph

Reply | Threaded
Open this post in threaded view
|

Re: mydomain and myhostname

Wietse Venema
Christoph Pleger:

> > - i.e. what you see when you type 'hostname' at the command line, which
> > in
> > turn is usually taken from the contents of /etc/hostname. And mydomain
> > is
> > by default derived from myhostname. If you update /etc/hostname you may
> > also need to update /etc/hosts.
>
> The format of /etc/hostname and /etc/hosts is exactly the same on the
> two machines, only the actual values differ. /etc/hostname contains the
> non-FQDN name, /etc/hosts contains first the FQDN and then the non-FQDN.

Postfix does not look in /etc/hosts, but on Debian/Ubuntu the main.cf
myorigin setting may specify a filename. Even that has no effect
on the default myhostname/mydomain setting.

        Wietse