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

Re: Should hostname always be lower case?



On Lu, 12 mai 14, 19:35:40, Ron Leach wrote:
> 
> I've read man hosts, resolv.conf, and nsswitch.conf; I've also had a look at
> http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution
> (I'm assuming that's an official site).
> 
> On the Wheezy machine, /etc/nsswitch.conf contains
> 
> hosts:	files mdns4_minimal [NOTFOUND=return] dns mdns4
> 
> From my reading, since 'files' is listed first, /etc/hosts should be checked
> for name resolution first, with external requests to a dns resolver *only*
> if the host name is not found in hosts file.
> 
> But the behaviour I am seeing is that the box is asking for resolution (of
> its own hostname, actually) from an external resolver.  (That DNS resolution
> request fails, anyway, because there is no record for its hostname in the
> DNS tree.)
> 
> /etc/hosts, on D7Server, contains a record for D7Server:
> 192.168.3.31<tab>D7Server<tab>d7server<tab>D7Server.inet<tab>d7server.inet
> 
> Despite the entry in hosts file, D7Server keeps asking the DNS resolver to
> lookup D7Server (the request is logged on the DNS resolver machine), instead
> of reading it from its hosts file.
> 
> Do I need to do something more to enable names to be looked up in
> /etc/hosts?

Whenever diagnosing such issues it is a good idea to use getent(1) and 
*not* DNS tools like dig or nslookup, because these use their own 
resolver (library).

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt

Attachment: signature.asc
Description: Digital signature


Reply to: