/* - 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;
include "/etc/named.rfc1912.zones"; # 这是解析区域文件的目录 include "/etc/named.root.key";
DNS服务启动方式
systemctl start named
五、 内网NDP服务(时间服务器)
1、安装ntp
yum install ntp
2、编辑配置文件:/etc/ntp.conf
使用设备的本地时间作为时间源的配置:
driftfile /var/lib/ntp/drift
# 本地时钟作为备用(Stratum 10) server 127.127.1.0 fudge 127.127.1.0 stratum 1
# Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system. # restrict default nomodify notrap nopeer noepeer noquery
# Permit association with pool servers. # 用于限制外部客户端对NTP服务的访问权限,禁止其修改配置、发送控制消息、建立对等关联和查询时间信息 #restrict source nomodify notrap noepeer noquery
# Permit all access over the loopback interface. This could # be tightened as well, but to do so would effect some of # the administrative functions. # restrict 127.0.0.1 # restrict ::1
# Hosts on local network are less restricted. # 允许内网设备访问该时间服务器 #restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). # pool 2.kylin.pool.ntp.org iburst
# Reduce the maximum number of servers used from the pool. # tos maxclock 5指令用于控制NTP服务器在同步时间时考虑的最大候选服务器数量,设置为5意味着最多使用5个候选服务器。 # tos maxclock 5
# Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system. # restrict default nomodify notrap nopeer noepeer noquery
# Permit association with pool servers. # 用于限制外部客户端对NTP服务的访问权限,禁止其修改配置、发送控制消息、建立对等关联和查询时间信息 restrict source nomodify notrap noepeer noquery
# Permit all access over the loopback interface. This could # be tightened as well, but to do so would effect some of # the administrative functions. # restrict 127.0.0.1 # restrict ::1
# Hosts on local network are less restricted. # 允许内网设备访问该时间服务器 restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). # pool 2.kylin.pool.ntp.org iburst
# Reduce the maximum number of servers used from the pool. # tos maxclock 5指令用于控制NTP服务器在同步时间时考虑的最大候选服务器数量,设置为5意味着最多使用5个候选服务器。 tos maxclock 5
# Enable public key cryptography. # crypto
includefile /etc/ntp/crypto/pw
配置上游NTP服务器 阿里云与腾讯云
server ntp.aliyun.com iburst server ntp1.tencent.com iburst