Quoting Brian (a...@cityscape.co.uk):
> On Fri 28 Aug 2015 at 14:45:32 +0300, Reco wrote:
> > On Fri, 28 Aug 2015 12:09:08 +0100
> > Brian <a...@cityscape.co.uk> wrote:
> > > On Fri 28 Aug 2015 at 10:01:59 +0000, Curt wrote:
> > > > On 2015-08-28, David Wright <deb...@lionunicorn.co.uk> wrote:
> > > > > $ host localhost
> > > > > Host localhost not found: 3(NXDOMAIN)
> > > > > $ ping localhost
> > > > > PING localhost (127.0.0.1) 56(84) bytes of data.
> > > > > 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.032 ms
> > > > 
> > > > curty@einstein:~$ host localhost
> > > > localhost has address 127.0.0.1
> > > > localhost has IPv6 address ::1
> > > 
> > > To complete the picture:
> > > 
> > >   brian@desktop:~$ dig -x 127.0.0.1
> > > 
> > >   ; <<>> DiG 9.9.5-9-Debian <<>> -x 127.0.0.1
[...]
> > >   ;; ANSWER SECTION:
> > >   1.0.0.127.in-addr.arpa. 10800   IN      PTR     localhost.
[...]
> > > host and dig use only the DNS.
> > > 
> > > Elimar's suggestion to use 'host $(hostname)' will work if hostname is
> > > a FQDN. But it shouldn't (or wouldn't) be on a stock Debian system.
> > 
> > Not unless said 'stock Debian system' has 'search <domain>' stanza
> > in /etc/resolv.conf.
> 
> Does "search example.org" count? :)
> 
> What is not understandable (to me) is why 'host localhost' resolves for
> some but not for others

Is it as simple as: routers with a caching nameserver can resolve
hostnames (because they've either been told it or issued it) whereas
those without can't (even if they issued it with their DHCP server).

> and why it is thought 'host $(hostname)' should
> resolve in the DNS.

Is it because, having no dots, the router's caching nameserver
should not query the external nameservers, but can resolve
the name itself, so it does so (à la RFC6761).

In my own instance, hostname == domainname (and no search),
and my router has no DNS function, only DHCP.

Cheers,
David.

Reply via email to