bind9 安装:部署自建dns系统
生活随笔
收集整理的這篇文章主要介紹了
bind9 安装:部署自建dns系统
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
#aliyun yum源
curl -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/CentOS-7.repo
或
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repoyum install epel-release
yum install wget net-tools telnet tree nmap sysstat lrzsz dos2unix bind-utils -ynslookup www.qq.com
yum install bind -y
[root@master-0 ~]# rpm -qa bind
bind-9.11.4-16.P2.el7_8.6.x86_64vim /etc/named.conf 改動(dòng)如下:
listen-on port 53 { 192.168.116.101; };
//listen-on-v6 port 53 { ::1; }; //注釋掉
allow-query { any; }; //允許所有局域網(wǎng)內(nèi)機(jī)器訪問(wèn)
forwarders { 192.168.116.1; }; //網(wǎng)關(guān)地址
recursion yes; //采用遞歸的方式
dnssec-enable no; //關(guān)閉
dnssec-validation no;#檢查配置是否正確,無(wú)異常輸出表示正常
[root@master-0 ~]# named-checkconf
[root@master-0 ~]##查看網(wǎng)關(guān)地址
[root@master-0 ~]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.116.1 0.0.0.0 UG 0 0 0 enp1s0#區(qū)域配置文件
vim /etc/named.rfc1912.zones43 zone "host.com" IN {44 type master;45 file "host.com.zone";46 allow-update { 192.168.116.101; };47 };4849 zone "od.com" IN {50 type master;51 file "od.com.zone";52 allow-update { 192.168.116.101; };53 };vim /var/named/host.com.zone
;是注釋1 $ORIGIN host.com.2 $TTL 600 ; 10 minutes3 @ IN SOA dns.host.com. dnsadmin.host.com. (4 2020062901 ; serial5 10800 ; refresh (3 hours)6 900 ; retry (15 minutes)7 604800 ; expire (1 week)8 86400 ; minimum (1 day)9 )10 NS dns.host.com.11 $TTL 60 ; 1 minute12 dns A 192.168.116.10113 master-0 A 192.168.116.10114 worker-01 A 192.168.101.11815 worker-02 A 192.168.101.11916 worker-04 A 192.168.101.12117 worker-05 A 192.168.101.122vim /var/named/od.com.zone
1 $ORIGIN od.com.2 $TTL 600 ; 10 minutes3 @ IN SOA dns.od.com. dnsadmin.od.com. (4 2020062901 ; serial5 10800 ; refresh (3 hours)6 900 ; retry (15 minutes)7 604800 ; expire (1 week)8 86400 ; minimum (1 day)9 )10 NS dns.od.com.11 $TTL 60 ; 1 minute12 dns A 192.168.116.101#檢查配置
[root@master-0 ~]# named-checkconf
[root@master-0 ~]##啟動(dòng)
systemctl start named[root@master-0 ~]# netstat -luntp|grep 53
tcp 0 0 192.168.116.101:53 0.0.0.0:* LISTEN 26475/named
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 26475/named
tcp 0 0 0.0.0.0:44453 0.0.0.0:* LISTEN -
tcp6 0 0 :::31538 :::* LISTEN 10484/kube-proxy
tcp6 0 0 ::1:953 :::* LISTEN 26475/named
tcp6 0 0 :::443 :::* LISTEN 8538/docker-proxy
udp 0 0 192.168.116.101:53 0.0.0.0:* 26475/named
[root@master-0 ~]##dig一下
[root@master-0 ~]# dig -t A master-0.host.com @192.168.116.101 +short
192.168.116.101
[root@master-0 ~]#vim /etc/sysconfig/network-scripts/ifcfg-enp1s0
改為
DNS1=192.168.116.101
#備份
21 DNS1=202.103.24.68
22 DNS2=202.103.44.150systemctl restart networkvim /etc/resolv.conf
search host.com #add這一行 restart network后會(huì)自動(dòng)添加add
win客戶端改DNS服務(wù)器:
空格和空行都嚴(yán)格保持一致!!!
啟動(dòng)named服務(wù):
驗(yàn)證:
總結(jié)
以上是生活随笔為你收集整理的bind9 安装:部署自建dns系统的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: harbor 2.0.1安装部署
- 下一篇: sqlplus远程连接k8s集群部署的o