[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: domain names, was: hostname



In case it's not clear,
hostname:    foo (in /etc/hostname),
domain:      example.com (name of a registered domain),
domain name: I'll try to avoid,
domainname:  foo.example.com (also variously called FQDN, canonical hostname).

On Mon 19 Feb 2018 at 18:39:02 (+0000), Brian wrote:
> On Mon 19 Feb 2018 at 10:23:56 -0600, David Wright wrote:
> 
> > On Mon 19 Feb 2018 at 12:28:03 (+0000), Jeremy Nicoll wrote:
> > > On Thu, 15 Feb 2018, at 16:21, Dan Purgert wrote:
> > > 
> > > > > Later, once you understand how a local network works, you can come
> > > > > up with a theme.  Or some convention that lets you identify the
> > > > > computer by its name.  The name that you have chosen.
> > > 
> > > Machine-naming makes sense to me - having done that with a variety
> > > of (blush) Windows machines in my LAN.  I've toyed with versions of 
> > > Linux, and used a few live-CD ones over the years, and I'm fairly sure
> > > that as well as being asked to supply a hostname I've also been asked 
> > > to supply a domain value.
> > > 
> > > What, on a home LAN, is that used for?
> > 
> > Nothing,

I ought to elaborate: giving an empty answer to the name of the domain
results in the domainname being the same as the hostname. So in places
where one might expect to see a domainname, just the hostname is seen.
It's difficult to use the domain's name for anything because it is empty.

> > with the possible exceptions of:
> > 
> > . avoiding this message at boot up:
> >   Mon Feb 19 04:58:38 2018: [....] Starting MTA:hostname --fqdn did not return a fully qualified name,
> >   Mon Feb 19 04:58:38 2018: dc_minimaldns will not work. Please fix your /etc/hosts setup.

I've never worked out exactly what it is that "will not work".
Having any string as a domain will make exim4 very happy because
there will be a dot in the canonical hostname in /etc/hosts.

> > . satisfying a broken smarthost¹,
                         ² later …

> > . causing some discussion here.

It certainly did that.

> > However, even though bug #504427 has never been answered, I don't
> > think I'm seeing this message any more except on wheezy (as above).
> > So here I have:
> > 
> > $ cat /etc/mailname 
> > alum
> 
> Debian's exim4 README says that mailname should be a FQDN. I find that
> useful for sending mail to "anotheruser".

Sorry, but I haven't been able to work out what you mean.
Is "anotheruser" a username on the same system, somebody or
some machine on the LAN, or something different?

This is a genuine query. If I'm missing out on some useful aspect
of writing in a domain, I'd like to know what it is so I can try
using it. (I have a spare domain registration handy as it happens.)

> But mailname has nothing to
> do with domain as enquired about by Jeremy Nicoll.

The contents of /etc/mailname is the answer to this question:
"It should be the single, fully qualified domainname (FQDN)."
so, because the domain is empty, the FQDN will be the same as
the hostname. I was merely showing that to be the case here.

As pointed out elsewhere, mailname can be used to generate
Message-IDs (mutt does) which might not be globally unique,
not something to concern most home users, and it can be
mitigated. It's also used as the envelope-from, it appears,
between the mail client and exim which can rewrite it.
I guess that if you submit mail directly from, say, mutt to
a remote smarthost, it would be a good idea to place an
email address into /etc/mailname.

> > $ head /etc/hosts
> > # /root/hosts-1-local-template
> > # List of local hosts.
> > # Adjust the two lines for this host when installing.
> > # Check the IPv6 lines occasionally because they change them.
> > 
> > 127.0.0.1       localhost
> > 127.0.1.1       alum
> 
> alum is the canonical_hostname. It is used by exim to HELO with. Many
> mail servers will not accept mail directly from you because it is not a
> FQDN.

This is why I wrote "broken" at ². The OP wrote "on a home LAN",
in which case it's unlikely that they relay mail to mail servers
on port 25. More likely is that they use a smarthost with a mail
submission system on port 587 or possibly 465 (though 25 is
allowed for broken senders³).

As submission involves obligatory authentication, there's no reason
to reject a submission just because the HELO has no dot in it. And
even if a sender screws up the envelope-from, it's likely that the
mail submission knows a valid email address associated with the
authenticator's registration details.

> > 192.168.1.1     router
> > 192.168.1.2     roku2w
> > $ 
> > 
> > I've sometimes wondered what other people dream up as their
> > domainnames; that is, people who don't have a legitimate reason
> > to put something like example.com.
> 
> Whatever is dreamt up as a domain name is put into /etc/hosts by the
> installer as
> 
> 127.0.1.1   alum.dreamtup    alum

And what is the benefit for the mail submission system in being woken
up with   HELO alum.dreamtup   rather than   HELO alum   ?
Extra brownie points for imagination perhaps.

³ like many routers that can only email the logs on port 25 of their WAN,
which will be immediately rejected by an increasing number of ISPs.

Cheers,
David.


Reply to: