马哥博客N46第9周作业
1、配置 bind 服务,实现 www.magedu.org 域名解析;
安装DNS服务器软件包bind;
yum -y install bind bind-utils
启动服务并设置下次开机启动;
systemctl enable named.service
systemctl start named.service
修改DNS主配置文件;
vim /etc/named.conf
listen-on port 53 { localhost; };
allow-query { any; };
allow-transfer { 192.168.88.200; };
重新加载DNS配置文件;
rndc reload
创建magedu.org正向Zone配置文件:
vim /var/named/magedu.org.zone
内容如下:
$TTL 1D
@ IN SOA master admin ( 0 1D 1H 3D 1H )
NS master
master A 192.168.88.100
www A 192.168.88.101
* A 192.168.88.101
@ A 192.168.88.100
2、配置 bind 服务,实现域名反向解析;
vim /var/named/88.168.192.in-arpa.zone
内容如下:
$TTL 1D
@ IN SOA master admin.magedu.org. ( 0 1D 1H 3D 1H )
NS master.magedu.org.
100 PTR master.magedu.org.
101 PTR www.magedu.org.
chown :named /var/named/magedu.org.zone
chmod 640 /var/named/magedu.org.zone
chown :named /var/named/88.168.192-in.apra.zone
chmod 640 /var/named/88.168.192.in-arpa.zone
vim /etc/named.rfc1912.zones
增加以下内容:
zone "magedu.org" {
type master;
file "magedu.org.zone";
};
zone "88.168.192.in-addr.arpa" {
36: type master;
37: file "88.168.192.in-arpa.zone";
38:};
named-checkconf
named-checkzone magedu.org /var/named/magedu.org.zone
named-checkzone 1.168.192.in-addr.arpa /var/named/reverse.zone
rndc reload
firewall-cmd --permanent --add-service=dns
firewall-cmd --reload
3、配置 bind 服务,实现主从 DNS 服务配置;
yum install bind bind-utils
systemctl enable named.service
systemctl start named.service
vim /etc/named.conf
修改以下配置
listen-on port 53 { localhost; };
allow-query { any; };
allow-transfer { none; };
vim /etc/named.rfc1912.zones
增加以下内容
zone "magedu.org" {
type slave;
masters { 192.168.88.100; };
file "slaves/magedu.org.slave.zone";
};
zone "88.168.192.in-addr.arpa" {
type slave;
masters { 192.168.88.100; };
file "slaves/reverse.slave.zone";
};
named-checkconf
rndc reload
firewall-cmd --permanent --add-service=dns
firewall-cmd --reload
4、配置 bind 服务,实现子域服务器;
主DNS服务器修改magedu.org.zone
vim /var/named/magedu.org.zone
内容如下:
$TTL 1D
@ IN SOA master admin ( 1 1D 1H 3D 1H ) #序列由原来的0改为1
NS master
NS slave
k8s NS ns
master A 192.168.88.100
slave A 192.168.88.200
ns A 192.168.88.201
www A 192.168.88.101
* A 192.168.1.101
@ A 192.168.1.101
DNS子域服务器bind软件包安装及配置;
yum -y install bind bind-utils
systemctl start named.service
systemctl enable named.service
vim /etc/named.conf
修改以下内容
13:listen-on port 53 { localhost; };
21:allow-query { any; };
vim /var/named/k8s.magedu.org.zone
内容如下:
$TTL 1D
@ IN SOA ns admin ( 0 1H 10M 1D 1H )
NS ns
ns A 192.168.88.201
master A 192.168.88.202
node A 192.168.88.203
etcd A 192.168.88.204
vim /etc/named.rfc1912.zones
zone "k8s.magedu.org" {
type master;
file "k8s.magedu.org.zone";
};
chown :named /var/named/k8s.magedu.org.zone
chmod 640 /var/named/k8s.magedu.org.zone
named-checkconf
named-checkzone k8s.magedu.org /var/named/k8s.magedu.org.zone
rndc reload
firewall-cmd --permanent --add-service=dns
firewall-cmd --reload