Install
apt-get install bind9
Reload dns server configuration
rndc reload
named.conf file fragment
....
options {
....
// stop everyone
allow-transfer {"none";};
....
};
zone "example.com" in{
type master;
file "master/master.example.com";
// explicitly allow slave
allow-transfer {192.168.0.4;};
};
Zone file
; zone fragment for 'zone name' example.com
; name servers in the same zone
$TTL 2d ; zone default TT = 2 days
$ORIGIN example.com
@ IN SOA ns1.example.com. hostmaster.example.com. (
2003080800 ; serial number
2h ; refresh = 2 hours
15M ; update retry = 15 minutes
3W12h ; expiry = 3 weeks + 12 hours
2h20M ; minimum = 2 hours + 20 minutes
)
; main domain name servers
IN NS ns1.example.com.
IN NS ns2.example.com.
; mail servers for main domain
IN MX 10 mail.example.com.
; A records for name servers above
ns1 IN A 192.168.0.3
ns2 IN A 192.168.0.4
; A record for mail servers above
mail IN A 192.168.0.5
; other domain level hosts and services
bill IN A 192.168.0.6
....
; sub-domain definitions
$ORIGIN us.example.com.
IN MX 10 mail
; record above could have been written as
; us.example.com. IN MX 10 mail.us.example.com.
; A record for subdomain mail server
mail IN A 10.10.0.28
; the record above could have been written as
; mail.us.example.com. A 10.10.0.28 if it's less confusing
ftp IN A 10.10.0.29
; the record above could have been written as
; ftp.us.example.com. A 10.10.0.29 if it's less confusing
....
; other subdomain definitions as required
; snippet from file above showing use of $INCLUDE
....
; other domain level hosts and services
bill IN A 192.168.0.5
....
; sub-domain definitions
$INCLUDE us-subdomain.sub
; other subdomain definitions as required