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

Re: Second time on hostname



Haines Brown wrote:
> I'm having some difficulties (From: line missing in header of outgoing
> newsgroup mesaages) and worry their cause might be due to what I put
> into /etc/hostname when I installed.  

I think you need to look at your news software first.  The problem is
probably there.

> I had done some reading, got inconsistent answers, and ended by
> using as hostname my FQDN, teufel.hartford-hwp.com when I
> installed.

That will be fine.

> Since then I've seen suggestions to use only the local host
> name (teufel).

That will also be fine.

You are entering a religous discussion of whether hostnames should be
fully qualified or short names.  People feel very strongly about this
topic and threads of discussion have exceeded hundreds of posts.  The
old BSD way was to use fully qualifed names.  It is what I prefer.  It
just seems to work better.  Some programs such as Postfix expect the
fully qualifed hostname and if not then need special configuration
(e.g /etc/mailname to have the fully qualified name).

> Is "machine name" synonymous with "local host" name?

If I understand your question, yes.

> A simple question for which I desperately need an answer: Should I
> have used only the local hostname?

You can do either.  I always use the fully qualifed domain name.  But
other people don't like that configuration and say to always use the
short name.  It is an emotionally charged topic.

> Secondary questions: does my use of FQND spell trouble?

No.  It should work fine.  If you are having specific problems post
them to the list.  It is almost certainly not with the hostname but
with something else such as the news software you mentioned.

> If so, some sources say never try to change your hostname, but do a
> reinstall instead;

That would be completely unnecessary.  I deploy hundreds of GNU/Linux
machines and always need to install them as a temporary name.  Then I
rename them into place when they get deployed.  There is no trouble
with renaming machines to a different hostname.

> others say, grep the /etc directory and change the name whereever it
> appears. Which is right?

The latter.  That is an easy brute force method.  You might see more
files than you really need to change.  Some are cached copies of the
master and really only the master needs to change.  But it would be
fine either way.  But certainly there is no need to reinstall.

> Should /etc/mailname be brownh#hartford-hwp.com?

No.  You said your fully qualified domain name was
teufel.hartford-hwp.com, right?  So that is what it should be.
However there are some special mail configurations that allow other
possibilities.

> Here, incidentally, are the returns from the hostname command:
> 
>   $ hostname 
>   teufel.hartford-hwp.com
Seems fine.

>   $ hostname -a
>   localhost

You probably have a line '127.0.0.1 teufel.hartford-hwp.com localhost'
in your /etc/hosts file.  The -a is looking for aliases but doing so
with an ad-hoc algorithm which is somewhat error prone.  That
/etc/hosts entry is confusing it.  But rather than change anything
(because having your name as the loopback device is fine) I would
ignore this.  It is not really useful anyway.

>   $ hostname -d
>   [nothing is returned]

Again, it is looking in /etc/hosts.  Don't worry about it.  It is a
silly algorithm.

>   $ hostname -f
>   localhost

Same.

>   $ hostname -s
>   localhost

Same.

> None of these seem right. 

The classic hostname has none of those options.  The person who wrote
that code had very particular ideas about how things should be
configured.  If your have a system that deviates from what hostname's
author expected then it gives funny answers.

There are several different possibilities with several different
variables producing several different valid combinations.  Neither is
really right or wrong.  In the end you just have to choose what you
like best.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: