I have configured a zone in my bind9
installation. Its supposed to be a public nameserver which I am managing through a python script for dyndns subdomains. But my main website is hosted by 3rd party somewhere else and in near future I want to host them locally too. For now I want bind9 to look into local database for name resolution and in case of failure redirect to(or fetch from) external dns. Here is my config but its not working for external queries (example.com and www.example.com).
$ cat /etc/bind/named.conf.local
include "/etc/bind/zones.rfc1918";
zone "example.com" {
type master;
file "/etc/bind/zones/db.example.com";
allow-transfer { any; };
update-policy local;
};
$ cat /etc/bind/zones/db.example.com
$ORIGIN .
$TTL 172800 ; 2 days
example.com IN SOA ns1.example.com. hostmaster.example.com. (
116 ; serial
7200 ; refresh (2 hours)
900 ; retry (15 minutes)
1857600 ; expire (3 weeks 12 hours)
8400 ; minimum (2 hours 20 minutes)
)
NS ns1.example.com.
NS ns1.external-host.com.
NS ns2.external-host.com.
ns1.external-host.com A 1.2.3.1
ns2.external-host.com A 1.2.3.2
$ORIGIN example.com.
ns1 A 1.1.1.1
@ IN NS ns1.external-host.com.
@ IN NS ns2.external-host.com.
www IN NS ns1.external-host.com.
www IN NS ns2.external-host.com.
clients A 1.1.1.1
$ORIGIN clients.example.com.
$TTL 3600 ; 1 hour
test A 2.2.2.2