A DNS zone file contains info on the domain in its name. So if you have the domains "ons.com", "123.ons.com" and "456.ons.com" you will need a zone file for each. In the "ons.com" zone you will need to have DNS glue records for the "123.ons.com" and "456.ons.com" domains.
If you want all 3 domains to be on both servers and both be masters you would do something lie this:
Code:
zone "ons.com" {
type master;
file "/etc/bind/db.ons.com";
};
zone "123.ons.com" {
type master;
file "/etc/bind/db.123.ons.com";
};
zone "456.ons.com" {
type master;
file "/etc/bind/db.456.ons.com";
};
db.ons.com:
Code:
$ORIGIN .
$TTL 86400 ; 1 day
ons.com IN SOA ons.com. ons.com. (
131008000 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
2419200 ; expire (4 weeks)
86400 ; minimum (1 day)
)
$TTL 259200 ;3 days
$ORIGIN ons.com.
IN NS ns1
IN NS ns2
ns1 IN A 10.10.10.11
ns2 IN A 10.10.10.12
#DNS Domain Glue entries for 123.ons.com
$ORIGIN 123.ons.com.
IN NS ns1
IN NS ns2
ns1 IN A 10.10.10.11
ns2 IN A 10.10.10.12
#DNS Domain Glue entries for 456.ons.com
$ORIGIN 456.ons.com.
IN NS ns1
IN NS ns2
ns1 IN A 10.10.10.11
ns2 IN A 10.10.10.12
db.123.ons.com:
Code:
$ORIGIN .
$TTL 86400 ; 1 day
123.ons.com IN SOA 123.ons.com. 123.ons.com. (
131008000 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
2419200 ; expire (4 weeks)
86400 ; minimum (1 day)
)
$TTL 259200 ;3 days
$ORIGIN 123.ons.com.
IN NS ns1
IN NS ns2
ns1 IN A 10.10.10.11
ns2 IN A 10.10.10.12
db.456.ons.com:
Code:
$ORIGIN .
$TTL 86400 ; 1 day
456.ons.com IN SOA 456.ons.com. 456.ons.com. (
131008000 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
2419200 ; expire (4 weeks)
86400 ; minimum (1 day)
)
$TTL 259200 ;3 days
$ORIGIN 456.ons.com.
IN NS ns1
IN NS ns2
ns1 IN A 10.10.10.11
ns2 IN A 10.10.10.12
Or if you want server2.com to be a slave to server1.com your zone definition would be like this:
Code:
zone "ons.com" {
type slave;
file "/etc/bind/db.ons.com";
masters { 10.10.10.11 ; };
};
zone "123.ons.com" {
type slave;
file "/etc/bind/db.123.ons.com";
masters { 10.10.10.11 ; };
};
zone "456.ons.com" {
type slave;
file "/etc/bind/db.456.ons.com";
masters { 10.10.10.11 ; };
};
Bookmarks