Xfce unable to lookup hostname

Polytropon freebsd at edvax.de
Fri May 8 03:58:32 UTC 2009


On Thu, 7 May 2009 20:26:40 -0400, Daniel Underwood <djuatdelta at gmail.com> wrote:
> I added the line
> 
> "127.0.0.1     bsdbox     bsdbox.my.domain"
> 
> and now it works perfectly, thanks!
> 
> Question: what does the line I added tell my computer? I.e., what does
> that line "do"?

It simply associates the given hostname to that IP adress. This
enables the system to resolve to this IP when the "literal" name
is given. This resolution is one of the basic principles.

Allthough the line works, it should be formed this way (or, it
should be two lines):

	127.0.0.1	<hostname>.<domain> <hostname>
	127.0.0.1	<hostname>.<domain>.

Note the dot. In your case, it would be

	127.0.0.1	bsdbox.my.domain bsdbox
	127.0.0.1	bsdbox.my.domain.

This enables the following resolve patterns:

	bsdbox			-----> 127.0.0.1
	bsdbox.my.domain	-----> 127.0.0.1 (You've got only this)

The first one is the "alias" / "short name" of the host, its
hostname. The second one is the "full name" including the
hostname and the domainname.

Refer to

	% man hosts

for a much better explaination. :-)

An addition: It's important that the system can resolve "localhost",
too, because that's an important "reserved literal name". For
example, the CUPS often addresses "localhost:631" (if I
remember correctly, I use apsfilter). Furthermore, the system's
mail subsystem relies on such settings.

So you could add or complete:

	::1		localhost
	127.0.0.1	localhost

It can cause big (stupid) problems if you miss them. :-)




-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list