I'm trying to deploy A dns Forwarder using Bind9 (Linux). I want that my server will be able to analyze requests and forward it to exeternal DNS (internet) or internal using condition implemented. So we will use : DNS forwarder : server that will analyze and forwarder requests to internal or external DNS Internal DNS : Server that resolve only internal names (domain.company) DNS : 8.8.8.8 :resolving external address
So the goal is when i try to resolve a domain name/URI. If it's internal that request should be forwarded to internal DNS else it should be forwarded to 8.8.8.8
Exemple1 : nslookup google.com should be forwarded to 8.8.8.8
Exemple2 : nslookup application.domain.company should be forwarded to internal dnsserver
and here the content of /etc/named.conf
//
// named.conf
options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 { any; };
auth-nxdomain no;
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";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
recursion yes;
allow-query { 127.0.0.1; IPCLIENT2; IPclient1; };
forwarders {
8.8.8.8;
};
forward first;
dnssec-enable yes;
dnssec-validation auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.root.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "domain.compagny" IN {
type forward;
forward only;
forwarders { IP_internaldns; };
};
zone "domain2.compagny" IN {
type forward;
forward only;
forwarders { IP_internaldns; };
};
#include "/etc/named.rfc1912.zones";
#include "/etc/named.root.key";
Here if I execute : nslookup google.com or yahoo
It resolves correctly
But if I execute nslookup application.domain.compagny
it displays : can't find XXXXXXXX: SERVFAIL
Thanks