DNS (bind) example configuration with master and slave

Posted on Tue 20 December 2005

/etc/bind/named.conf

options {
listen-on port 53 { 127.0.0.1; 192.168.2.1; server-ip; };
allow-recursion { 127.0.0.1; 192.168.2.0/24; };
allow-query { any; };
allow-transfer { provider-dns-ip; slave-dns-ip-1; slave-dns-ip-2; slave-dns-ip-3; };
};
zone "." {
type hint;
file "/etc/bind/db.root";
};
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "1.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
zone "my-domen.com.ua" {
type master;
file "/etc/bind/db.my";
allow-transfer { provider-dns-ip; slave-dns-ip-1; slave-dns-ip-2; slave-dns-ip-3;};
};
zone "ns2.my-domen.com.ua" {
type slave;
file "/etc/bind/db.office";
masters {master-dns-ip;};
};

/etc/bind/db.my

$TTL 2D
@ IN SOA ns.my-domen.com.ua. root.my-domen.com.ua. (
2008061500 ; serial
1H ; refresh
1H ; retry
1W ; expiry
1D ) ; minimum
; DNS Servers
my-domen.com.ua. IN NS ns.my-domen.com.ua.
my-domen.com.ua. IN NS ns3.my-domen.com.ua.
my-domen.com.ua. IN NS ns4.my-domen.com.ua.
my-domen.com.ua. IN NS ns.provider.net.
; MX Records
my-domen.com.ua. IN MX 10 post.my-domen.com.ua.
my-domen.com.ua. IN MX 15 mx.my-domen.com.ua.
my-domen.com.ua. IN MX 20 mail.my-domen.com.ua.
; Machine Names
my-domen.com.ua. IN A 123.123.123.123
ns.provider.net. IN A 123.123.123.123
ns IN A 123.123.123.123
ns2.my-domen.com.ua. IN NS m.ns2.my-domen.com.ua.
m.ns2.my-domen.com.ua. IN A 123.123.123.123
ns3 IN A 123.123.123.123
ns4 IN A 123.123.123.123
www IN A 123.123.123.123