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

Re: Debian and FQDN lookup

Brian wrote:
> Every time I use d-i in expert mode I wonder what other people make of
> it. I was puzzled by it the very first time and even now think it is
> one of the most difficult fields to fill in because the background
> knowledge needed isn't immediately as apparent as it is with language
> or location, say. The installation manual is really of no help as it
> has little commentary on its significance,

I only very rarely use expert mode.  I almost always use the normal
mode.  Then I fix up anything I want to change after the installation
is complete.

> As an example, let us suppose your ISP in the UK is
> talktalk.co.uk. You put this as your domain name because that is all
> you can think of. After all, it is in your email address and you do
> not have your own domain.

I am spoiled because for my installations there has always been a
valid domain name to use.  It is good to be reminded that not everyone
has that environment.  Thanks.

> Your hostname is copernicus. So your canonical hostname becomes
> copernicus.bt.com, which doen't exist and doesn't resolve. Now -
> what harm is done?

No immediate harm.  Some strange things with mail routing and so
forth.  But very few people do local mail delivery these days.  And
that would be mostly fine regardless.  It would provide the domain in
the /etc/hosts file.  That would make most things happy.

> Leaving the field blank often gets you what your
> router provides; copernicus.lan in my case.

Cool!  What mechanism supports that happening?  Is the default domain
in your router's dhcp config the .lan domain?

David Wright wrote:
> Quoting David Wright (deblis@lionunicorn.co.uk):
> > Do you think there's time to get such advice into jessie's installer
> > for domestic users (assuming it's good advice)?
> ... er, or even the opposite advice (appendix G) which shows how
> fraught this area is!

Yes.  Certainly!  It is a confusing topic.  *I* am confused by the
topic of local private domains.  It would be good to provide some
guidance at installation time.

And now a short diversion about Postfix related to hostnames...

Previously in Wheezy 7 and before postfix $mydomain defaulted to
$myhostname minus the first component, or "localdomain".  $myhostname
defaulted to gethostname() and if that had no dots it appended
$mydomain forming names such as foo.localdomain when the configured
hostname was a short name (the general Debian recommendation) rather
than a FQDN.  That would match the names used in /etc/hosts and
everything would work.  For a system defaulting to localhost:

  root@localhost:~# postconf -d myhostname
  myhostname = localhost.localdomain
  root@localhost:~# postconf -d mydomain
  mydomain = localdomain

To set correct domains I always set myhostname explicitly to the FQDN
in the Postfix main.cf configuration.  Setting just myorigin =
/etc/mailname (a Debian specific patch) doesn't really set all of the
names correctly for a standalone system.

  root@localhost:~# postconf -d myorigin
  myorigin = $myhostname

AFAICS the defaults of setting localhost.localdomain both in
/etc/hosts and in the Postfix config cause the complete loop to be
correct and work for the simple standalone unconnected case.  It will
get localhost.localdomain in both places and the virtual circuit is
valid throughout.  Local delivery at least works without errors.

Of course someone setting up a full mail server will need to assign a
valid hostname and a valid domain name.  That connects everything
correctly too.

The "interesting" case is when there is a local hostname that isn't
"localhost" but no valid domain has been set.  That should never
happen on a system trying to be a valid mail server.  But it obviously
does get set up by users just installing the system and trying to do
the best they can with the information they have at the time.  That
feels like a corner case to me.  One that should be discouraged.
Having some extra description at installation time to help avoid it
would be a good thing in my opinion.  It would avoid the cases where
'hostname -f' returns a name without any dots which confuses software
written that insists there must be dots in there.


Attachment: signature.asc
Description: Digital signature

Reply to: