系统运维-19-1-bind高级应用之子域授权与服务转发

1.关于父域服务器配置

vim /etc/named.conf编辑配置文件。systemctl reload named载入配置。cat /etc/named.conf | grep -v ^$ | grep -v ^\/查看配置文件。vim /etc/named.rfc1912.zones 编辑配置文件。tail -5 /etc/named.rfc1912.zones查看增加的父域解析文件定义。 rndc reload载入配置。tail /var/log/messages查看日志。vim /var/named/example.com.zone编辑父域解析文件。 cat /var/named/example.com.zone 查看父域解析文件。rndc reload载入配置。

[root@lab1 ~]# vim /etc/named.conf
[root@lab1 ~]# systemctl reload named
[root@lab1 ~]# cat /etc/named.conf | grep -v ^$ | grep -v ^\/
options {
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
    recursing-file  "/var/named/data/named.recursing";
    secroots-file   "/var/named/data/named.secroots";
    /* 
     - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
     - If you are building a RECURSIVE (caching) DNS server, you need to enable 
       recursion. 
     - If your recursive DNS server has a public IP address, you MUST enable access 
       control to limit queries to your legitimate users. Failing to do so will
       cause your server to become part of large scale DNS amplification 
       attacks. Implementing BCP38 within your network would greatly
       reduce such attack surface 
    */
    recursion yes;
    /* Path to ISC DLV key */
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
zone "." IN {
    type hint;
    file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
[root@lab1 ~]# vim /etc/named.rfc1912.zones 

[root@lab1 ~]# tail -5 /etc/named.rfc1912.zones
zone "example.com" IN {
        type master;
        file "example.com.zone";
};
[root@lab1 ~]# rndc reload
server reload successful
[root@lab1 ~]# tail /var/log/messages
Jan 17 07:07:11 lab1 named[975]: automatic empty zone: 8.E.F.IP6.ARPA
Jan 17 07:07:11 lab1 named[975]: automatic empty zone: 9.E.F.IP6.ARPA
Jan 17 07:07:11 lab1 named[975]: automatic empty zone: A.E.F.IP6.ARPA
Jan 17 07:07:11 lab1 named[975]: automatic empty zone: B.E.F.IP6.ARPA
Jan 17 07:07:11 lab1 named[975]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA
Jan 17 07:07:11 lab1 named[975]: zone 0.20.172.in-addr.arpa/IN: (master) removed
Jan 17 07:07:11 lab1 named[975]: reloading configuration succeeded
Jan 17 07:07:11 lab1 named[975]: reloading zones succeeded
Jan 17 07:07:11 lab1 named[975]: all zones loaded
Jan 17 07:07:11 lab1 named[975]: running

[root@lab1 ~]# vim /var/named/example.com.zone 
[root@lab1 ~]# cat /var/named/example.com.zone
$TTL 86400
$ORIGIN example.com.
@       IN      SOA      ns1.example.com.   admin.example.com.  (
                         2019011701
                         1H
                         5M
                         3D
                         1D  )
        IN      NS       ns1
        IN      NS       ns2
ns1     IN      A        172.20.0.131
ns2     IN      A        172.20.0.132
www     IN      A        172.20.0.131
*       IN      A        172.20.0.131
[root@lab1 ~]# named-checkzone "example.com" /var/named/example.com.zone
zone example.com/IN: loaded serial 2019011701
OK
[root@lab1 ~]# ll /var/named/example.com.zone
-rw-r-----. 1 root named 459 Jan 17 07:09 /var/named/example.com.zone
[root@lab1 ~]# rndc reload
server reload successful
[root@lab1 ~]# tail /var/log/messages
Jan

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值