智能域名解析
作者:互联网
智能域名解析
options {
directory "/var/named";
};
include "/var/named/lan.txt";
include "/var/named/wan.txt";
view "LAN" {
match-clients { lan; };
zone "dou.com" IN {
type master;
file "dou.lan";
};
};
view "WAN" {
match-clients { wan; };
zone "dou.com" IN {
type master;
file "dou.wan";
};
};
100网段
[root@localhost named]# cat /var/named/dou.wan
$TTL 86400
@ IN SOA dou.com. mail.dou.com. (
20190826
1D
1H
1W
3H
)
NS ns1.dou.com.
NS ns2.dou.com.
ns1 A 192.168.100.11
ns2 A 192.168.100.12
www A 192.168.100.13~ 200网段
[root@localhost named]# cat /var/named/dou.lan
$TTL 86400
@ IN SOA dou.com. mail.dou.com. (
20190826
1D
1H
1W
3H
)
NS ns1.dou.com.
NS ns2.dou.com.
ns1 A 192.168.200.111
ns2 A 192.168.200.112
www A 192.168.200.113
wan文件
[root@localhost named]# cat wan.txt
acl wan {
192.168.100.0/24;
}; lan文件
[root@localhost named]# cat lan.txt
acl lan {
192.168.200.0/24;
};
options {
directory "/var/named";
};
include "/var/named/lan.txt";
include "/var/named/wan.txt";
view "LAN" {
match-clients { lan; };
zone "dou.com" IN {
type master;
file "dou.lan";
};
};
view "WAN" {
match-clients { wan; };
zone "dou.com" IN {
type master;
file "dou.wan";
};
};
100网段
[root@localhost named]# cat /var/named/dou.wan
$TTL 86400
@ IN SOA dou.com. mail.dou.com. (
20190826
1D
1H
1W
3H
)
NS ns1.dou.com.
NS ns2.dou.com.
ns1 A 192.168.100.11
ns2 A 192.168.100.12
www A 192.168.100.13~ 200网段
[root@localhost named]# cat /var/named/dou.lan
$TTL 86400
@ IN SOA dou.com. mail.dou.com. (
20190826
1D
1H
1W
3H
)
NS ns1.dou.com.
NS ns2.dou.com.
ns1 A 192.168.200.111
ns2 A 192.168.200.112
www A 192.168.200.113
wan文件
[root@localhost named]# cat wan.txt
acl wan {
192.168.100.0/24;
}; lan文件
[root@localhost named]# cat lan.txt
acl lan {
192.168.200.0/24;
};
标签:wan,named,域名解析,192.168,lan,智能,com,dou 来源: https://www.cnblogs.com/CAPF/p/11414921.html