Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have bind configured (sort of) on CentOS 6 as a forward-only DNS server, like so:

options {
    listen-on port 53 { 127.0.0.1; };
    directory "/var/named";
    recursion yes;
    allow-recursion { localhost; };
    forward only;
    forwarders { 8.8.8.8; 8.8.4.4; };
};

include "/etc/named.rfc1912.zones";

The problem is, that it seems it's not doing any forwarding:

$ dig www.google.com

; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 1037
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com.                    IN      A

;; Query time: 555 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Jan 27 13:30:52 2012
;; MSG SIZE  rcvd: 32

I do not have bind-chroot installed on this server. I can confirm that my resolv.conf file is configured to use 127.0.0.1 for DNS lookups. If I do dig @8.8.8.8 www.google.com then I get a correct response.

If I remove the forwarding statements and add the hint zone for the root servers, then it does correctly resolve names, but of course I don't want to be hitting the root servers for every lookup. Any suggestions?

share|improve this question
    
Try running dig +trace to confirm named is working correctly. –  James O'Gorman Jan 27 '12 at 18:54

1 Answer 1

up vote 2 down vote accepted

I would suggest to add, beside localhost, the IP address of the machine itself:

allow-recursion {127.0.0.1; 192.168.1.1;}

Of course, you need to replace 192.168.1.1 with the real IP address you are using.

share|improve this answer

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.