I'm sadly restricted to a very old version of bind (9.4.2)

This is the think. If I setup bind with a named.conf and only forwarding it works perfect.

acl  clients    {
    any  ;

options {
    listen-on {; };
    forward only ;
    forwarders { ; } ; 
    allow-query { clients ; };
    max-cache-size 2097152 ; 
    empty-zones-enable no;
    querylog yes;
    directory "/usr/local/named/etc/zones";
    dump-file "/usr/local/named/cache_dump.db";
    statistics-file "/usr/local/named/named_stats.txt";
    version "not currently available";
    pid-file "/usr/local/named/var/run/named.pid";

As soon as I add a spoofed root zone it works as intended.

zone "." IN {
        type master;
        file "all.zone";
    notify no;

Where all.zone contains only a single A address with wildcard forwarding to it so all DNS queries get replied with that single address.

The problem I am facing is that I wan't to allow certain domains to be forwarded to the public DNS. Example below

zone "cnn.com" {
        type forward;
        forwarders {;; };

/** Spoofed **/
zone "." IN {
        type master;
        file "all.zone";
        notify no;

Every query to *.cnn.com gets replied with nothing (instead of the spoofed address)

nslookup www.cnn.com

*** Can't find www.cnn.com: No answer

# dig  @ www.www.cnn.com

; <<>> DiG 9.2.4 <<>> @ www.cnn.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20722
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;www.cnn.com.                   IN      A

.                       3600    IN      SOA     ns.example.com. 357 86400 3600 86400 3600

;; Query time: 1 msec
;; WHEN: Fri Feb  7 10:44:56 2014
;; MSG SIZE  rcvd: 86

However if I add a master zone to it (along with the forward zone and the spoofed root) it reques to queries fine.

zone "test.com" IN {
    type master;
    file "test.com.zone";

nslookup ns.test.com

Name:   ns.test.com

So, anyone might have any idea why when having a root spoofed zone it does reply to queries when there is a master zone but it doesn't forward when there is a forwarded zone?

Thanks in advance !

  • 1
    Try changing zone "cnn.com" to zone "cnn.com.". Just a stab in the dark. You've defined a forwarder with no root mentioned. The root is . and I'm not sure if it's implied for forwarding when you omit it. – Sean C. Feb 7 '14 at 14:44
  • You are right and it's a wrong copy paste. There is no forwarding on "." zone. I'll try your suggestion – jdq2013 Feb 7 '14 at 17:23
  • Sadly adding "cnn.com." didn't work :( – jdq2013 Feb 7 '14 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.