DNS (Domain Name Server) ---> Domain Name Service
DNS protocol runs over TCP and UDP protocol, TCP protocol is responsible for the link, which is responsible for parsing the UDP protocol, port number are 53 ports
experimental environment: CentOS 7.3
DNS host: 192.168.1.44
DNS slave: 192.168.1.54
primary DNS server is configuredDNS under Linux is to use bind implemented
procedures were named
the main program / usr / sbin / named
master configuration file /etc/named.conf
domain profile /etc/named.rfc1912.zones
resource configuration file / etc / named / under
the master dns server is configured
to download software named bind service
boot and start the service named
Close SELinux
View SELinux state
Note ---> experimental temporary settings, such as permanent in the configuration file / etc / sysconfig / selinux set
to join firewall mechanism
dns added firewall mechanism
view firewall mechanism
routing function enabled
NOTE ---> to be in / proc / sys / net / ipv4 / ip_forward profile settings
view named port opening 53 where
the configuration of the cache server forward resolution
master profile settings
modified file lines 13 and 19 within {} is any, 20 disposed forward line telecommunication server dns
34 lines changed to no close dns verification security
checks profile
domain profile settings
resource profile settings
to copy and save the file original attributes
modify file
check file syntax
to reload the
view loading conditions
test domain case
testing tool dig and nslookup, general use dig content full
dig test
Internal dedicated test
CNAME provided polling
test
.
Configuring a reverse caching server to resolve
set up a domain configuration file
resource profile settings
Reload test
.
配置双向解析的缓存服务器
查看帮助文档,双向解析配置
主配置文件设置
域配置文件设置
注 ---> 对内ip改为192.168.0.0/24网段
资源配置文件设置
重新加载,本地主机测试
注 ---> 非本地主机还是对外ip:172.25.254.131
.
DNS 主从同步配置
主从同步:主每次修改配置文件需要修改一下序列号,主从同步主要 看序列号
从DNS:从是可以单独修改,主从不会报错。但从修改后,主端同步给从后 从端修改数据会丢失
主从原理:从会监听主的 TCP 53 端口,它会隔一段时间去探测 序列号如果主端 序列号更新后 从端探测到会 将主端内容 同步到本地
同步模式:从主动探测时间比较缓慢,可以设置主端,每次变更序列号时主动将,数据信息,推送给从DNS端
从dns服务器配置
主配置文件设置
!
修改文件中的13和19行中{}内为any
域配置文件设置
注 ---> type slave类型为从dns服务类型,masters{{xxx}主dns服务器地址
修改etc/resolv.conf文件为从dns服务器地址172.25.254.31
主dns服务器www地址改为172.25.254.188重新加载
注 ---> 序列号修改为设置更改的时间,每次更改都要变更序列号
更改www地址
从dns服务器重新加载,dig测试
注 ---> 主从同步完成
.
Remote data updating dns
remote server profile settings dns
Note ---> allow-update allows to ip 172.25.254.31 remote server update data, also-notify to synchronize data received
local file server dns permission to modify
the local server remote synchronization data dns
dns server remote test dig, dig hello.test.com
local dns server test dig, dig hello.test.com
data synchronization complete
local dns server generates synchronous data file
Note ---> generate a data file type, view and edit not
available hexdump View binary file