Ubuntu配置Bind9

安装Bind9

aptitude install bind9 bind9-host dnsutils

配置文件

/etc/bind/named.conf
/etc/bind/named.conf.options
/etc/bind/named.conf.default-zones

view设置样例

ACL  dx {
59.77.2.237;92.168.190.129;192.168.190.133;192.168.190.151;192.168.190.128;192.168.52.130;
192.168.223.130;119.29.108.135;};
ACL  wt{
192.168.190.130;192.168.190.120;192.168.190.150;115.28.177.243;};
view "dx" { 
    match-clients { dx; };
    recursion no; 
    zone "xujc.com" IN {
        type master;
        file "xujc.com.zone.dx";
        allow-update { none ; };
    };

    zone "abc.com" IN {
        type master;
        file "abc.com.zone.dx";
        allow-update { none ; };
    };
};
view "wt" { 
    match-clients { wt; };
    recursion no; 

    zone "xujc.com" IN {
        type master;
        file "xujc.com.zone.wt";
        allow-update { none ; };
    };
    zone "abc.com" IN {
        type master;
        file "abc.com.zone.wt";
        allow-update { none ; };
    };
};

view "other" { 
    match-clients { any; };
    recursion no; 

    zone "xujc.com" IN {
        type master;
        file "xujc.com.zone.other";
        allow-update { none ; };
    };

    zone "abc.com" IN {
        type master;
        file "abc.com.zone.other";
        allow-update { none ; };
    };
};

options: directory “/var/cache/bind”; 设定zone目录

abc.com.zone样例:

$TTL 60
$ORIGIN abc.com.
@ IN SOA ns.abc.com. admin.abc.com.(
20090218;
28800;
15M;
1W;
1D)
@ IN NS ns.abc.com.
ns IN A 192.168.52.130
www IN A 192.168.1.1
mail  IN A 192.168.5.33

重启服务 rndc reload 或者 service named restart

你可能感兴趣的:(服务器配置教程)