Re: #host localhost
- From: Giorgos Keramidas <keramida@xxxxxxxxxxxxxxx>
- Date: Sat, 28 Jul 2007 04:57:31 +0300
On Fri, 27 Jul 2007 17:45:44 -0400, Oliver Cromm <lispamateur@xxxxxxxx> wrote:
Is there nothing one can do about "host localhost" showing nonsense?
Sure there is:
$ host localhost
localhost.laptop has address 127.0.0.1
$ host 127.0.0.1
1.0.0.127.in-addr.arpa domain name pointer localhost.laptop.
$ cat /etc/resolv.conf
search laptop
nameserver 127.0.0.1
$
The output shown above is a result of the named daemon running on my
laptop, but that's kind of besides the point here. The real point is
that if you are absolutely *determined* to make 'localhost' and
127.0.0.1 resolve correctly, both forwards and backwards, there _is_
indeed a way to do it. Naturally, running a local named daemon comes
with a cost -- the cost of learning about DNS and configuring your
own, local, caching named daemon -- but that's ok, I guess.
I spent an hour trying to "solve" this problem until I read a comment
to the effect that this doesn't work correctly on FreeBSD anyway, and
all is well if "ping localhost" goes right.
All my settings are the way it's described here:
http://wiki.unixboard.de/index.php/FreeBSD_-_Namensaufl%C3%B6sung
Can you post *here* what you have tried, what you expected to happen,
what you observed, and why you think this is a "FreeBSD problem"?
Not all the people who read newsgroup posts and reply to them are
constantly online, and there may be difficulties in tracking down the
web page and reading it.
But "host" insists on
1. adding the domain to "localhost", even when there is no "search"
in resolv.conf
2. using DNS to resolve, never the hosts file
This is _precisely_ the way the host(1) utility works. It specifically
mentions that it is a *DNS* *lookup* utility in its manpage.
If you want to debug and/or troubleshoot non-DNS resolution of host
names, domain names, or IP addresses, you will have to use some other
tool (i.e. 'ping' as you have found out already).
Maybe the man page for host should mention that? I guess I just ought to
use dig.
It does:
% HOST(1) BIND9 HOST(1)
%
% NAME
% host - DNS lookup utility
%
% SYNOPSIS
% host [-aCdlnrsTwv] [-c class] [-N ndots] [-R number] [-t type]
% [-W wait] [-m flag] [-4] [-6] {name} [server]
%
% DESCRIPTION
%
% host is a simple utility for performing DNS lookups. It is
% normally used to convert names to IP addresses and vice versa.
Nowhere does host(1) mention that it is expected to work, or that it
should indeed work for anything else *except* DNS. Please read the
manpage more carefully :-)
Well, host doesn't quite work on a RedHat Linux server at work, too,
the answer is:
Host localhost not found: 2(SERVFAIL)
That's ok. You have tried to resolve the non-qualified domain name
'localhost' and the Redhat implementation of host(1) didn't append any
domain name, even though the 'localhost' domain name lacks any '.'
character and is obviously 'unqualified'.
But that's slightly better than getting back an external IP. Is that
the fault of the DNS server I'm using (openDNS)?
Very likely. Haaving said that, if you don't like what an external
DNS server does, you can always install your own.
Regards,
Giorgos
.
- References:
- #host localhost
- From: Oliver Cromm
- #host localhost
- Prev by Date: Re: How to print all files from a directory with lpr?
- Next by Date: Re: Nub question: FreeBSD is graphic or text based?
- Previous by thread: Re: #host localhost
- Next by thread: How to use scp with socks5 proxy
- Index(es):
Relevant Pages
|