0

We have a DNS server internally that looks up IP addresses for all internal hosts and connects to root dns servers for all other domains (the rest of the internet). Here is my config

options {
    listen-on port 53 { 127.0.0.1;any; };
    listen-on-v6 port 53 { ::1; };
    directory       "/var/named";
    dump-file       "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     {192.168.1.0/24; 127.0.0.1; };
    recursion yes;
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

view “internal” { // What the home network will see

   match-clients      { 127.0.0.1;any; };
   match-destinations { 127.0.0.1;any; };

   recursion yes;

   zone "." IN {
        type hint;
        file "named.ca";
   };

   include "internal_zones.conf";
};

We need to tweak this to go to our ISPs dns, x.y.z.w instead of the root dns servers if the host cannot be resolved internally.

Config:

Fedora 10/Bind 9.5.2

3

You would need to use the forward only and forwarders options like this. Replace the google servers with the servers you need.

options {
...
    forward only;

    forwarders {
        8.8.8.8; // google public dns
        8.8.4.4;
    };
...
};
  • So it would lookup all internal hosts based on my internal_zones.conf file and all others would be forwarded? – ankimal May 3 '10 at 19:47
  • Yes, any request for records that cannot be answered by the lookups to the local zones will be forwarded. – Zoredache May 3 '10 at 19:49
  • Works like a charm! – ankimal May 3 '10 at 20:03
2

You can use global forwarders for this. Bind Documentation: Caching nameserver

Bind will forward the request when it can not provide the answer form itself.

You have to add the following lines to your Options section of the named.conf:

forwarders {
    x.y.z.w; w.z.y.x;
};

Your Answer

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

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