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

Re: hostname questions



This one time, at band camp, Michael Heironimus said:
> hostname uses the local files for all of its information, not DNS or any
> other naming service. hostname tells you what the machine thinks its own
> name is, DNS tells you what everybody else thinks the machine's name is.
> If you want the machine to think its own name is mercury and use that
> for your shell prompt, it sounds like you've probably got what you want
> (the rest of the world looks at the DNS entry).
> 
> Since the A record for the machine is mail.lobefin.net, I suppose that
> the correct way would actually be for the machine to have "mail" as its
> hostname, but it should work fine this way as long as you have your MTA
> set up to accept mail for every name it should (since it's the MX for
> lobefin.net I'll assume that you already have that done).
> 
> As for sqwebmail, I know nothing about that package. A lot of MUAs have
> a configuration option for setting the domain. It seems to me that it
> would be especially important for a webmail application to have a way to
> configure the default mail domain for all users, though.

OK, this is where I was getting hung up, forgetting about 'order hosts,
bind' in hosts.conf.  So, for others who may have this problem
(especially with sqwebmail, which is what started this tail-chasing)
this was the solution.

steve@mercury:~$ cat /etc/hosts
127.0.0.1   localhost
216.158.52.98   mail.lobefin.net mercury adsl-216-158-52-98-cust.oldcity.dca.net

This makes it correspond to:

steve@mercury:~$ hostname
mercury
steve@mercury:~$ hostname -a
mercury adsl-216-158-52-98-cust.oldcity.dca.net
steve@mercury:~$ hostname -s
mail
steve@mercury:~$ hostname -d
lobefin.net
steve@mercury:~$ hostname -i
216.158.52.98 
steve@mercury:~$ hostname -f
mail.lobefin.net

sqwebmail by contrast, runs on top of courier-mta, and gets it's hstname
settings from there.  courier-mta apparently looks for
/etc/courier/domainname, and if it doesn't find it, looks up the
hostname with hostname -f.  This is why this box kept setting all
outgoing webmail to $USER@mail.lobefin.net, instead of @lobefin.net.
So, put one line in new file /etc/courier/domainname and joy on all
fronts.  Thanks, Michael for all your help, and making me think again.
-- 
 ----------------------------------------------------------------------------
|Stephen Gran                  | Cat, n.:  Lapwarmer with built-in buzzer.   |
|steve@lobefin.net             |                                             |
|http://www.lobefin.net/~steve |                                             |
 ----------------------------------------------------------------------------

Attachment: pgpI18DipEW3F.pgp
Description: PGP signature


Reply to: