Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

in my LAN I use a small machine as server/gateway (with Ubuntu 10.04). On this server runs bind9 DNS server and all LAN clients are using it as unique DNS. Everything works ok, except that I'd like to find a method to consider server's /etc/hosts file.

For example, if my server's /etc/hosts file contains line:

192.168.10.5    testserver05.lan

I'd like to mirror the answer in bind. In fact now I get not found error:

root@nasinsu:/etc/bind# nslookup testserver05.lan
Server:     127.0.0.1
Address:    127.0.0.1#53

** server can't find testserver05.lan: NXDOMAIN

Is this possible?

share|improve this question
    
check content of /etc/nsswitch.conf (if I recall filename correctly). In case of hosts: dns files your resolver must (?) (TBT!) return answers based on all defined sources –  Lazy Badger Oct 26 '11 at 17:08

1 Answer 1

up vote 3 down vote accepted

Are you actually serving real zones in bind, or is it just acting as a cache/forwarder? If it is only a cache/forwarder, then you might want to take a look at DNSMASQ. DNSMASQ has a simple caching DNS server, and it can reference the local hosts file, and other files for answering requests.

share|improve this answer
    
Thx! apt-get install dnsmasq, apt-get remove --purge bind9 and... It works with no more configs! –  Fabio Oct 26 '11 at 17:01
    
Perfect, exactly what I was looking for. Thank you. –  Doc Aug 20 '13 at 17:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.