Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

Re: host.conf(5), hosts(5), host(1) question



 host and dig are both DNS tools.  /etc/hosts is an additional NON-DNS 
method of mapping hosts to IP addresses. 

I don't believe there's a way of getting etiher tool to interface with 
that file. 

On Thu, 29 Nov 2007, Bob - BLU wrote: 

> So I have the small bit of confusion.  When I use host (or dig), they don't 
> get info from the /etc/hosts file first, they instead go directly to the lan 
> name server.  I suspect this has something to do with dhclient, but I'm not 
> sure.  How can I get DNS lookups to first try /etc/hosts - what bit am I 
> missing? 
> 
> 
> # cat /etc/host.conf 
> order hosts,bind 
> 
> # cat /etc/hosts 
> 192.168.1.68    foo.bar.com foo 
> 
> # host -t A foo 
> foo.bar.com has no A record 
> 
> 
> # cat /etc/resolv.conf 
> ; generated by /sbin/dhclient-script 
> search bar.com 
> nameserver 192.168.1.200 
> 
> # host -d -v -t A foo 
> Trying "foo.bar.com" 
> ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 
> ;; QUESTION SECTION: 
> ;foo.bar.com.                   IN      A 
> ;; AUTHORITY SECTION: 
> bar.com.                86400   IN      SOA     bar.com. 
> root.localhost.bar.com. 2 28800 7200 604800 86400 
> Received 80 bytes from 192.168.1.200#53 in 1 ms 
> 
> 
> 
> -- 
> This message has been scanned for viruses and 
> dangerous content by MailScanner, and is 
> believed to be clean. 
> 
> _______________________________________________ 
> Discuss mailing list 
> [hidden email] 
> http://lists.blu.org/mailman/listinfo/discuss
> 


BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org