Test3 unit3

2023-01-31 05:01:01 Test3 unit3

unit3DNS



yum install bind -y                                  ##安装软件

wKioL1kQMPeQ7asbAABOP3PRpLM065.png  

systemctl stop firewalld                       ##关闭防火墙

systemctl start named                           ##开启服务

wKioL1kQMWyDFRDaAAApMVVwJEw197.png

vim /etc/named.conf                             ##修改配置文件

wKioL1kQMcaQiiP2AACFd1Jx49U749.png

systemctl restart named                          ##重启服务

netstat -antlpe | grep named                     ##查看端口状态

wKioL1kQMwSj7akHAACj0AFMtcg472.png

正向解析

vim /etc/named.rfc1912.zones                       ##修改配置文件

wKioL1kQM2Tx_i4OAAApWtT_tU4706.png

wKioL1kQNInyBuT0AAAt16cCdro829.png

cp -p /var/named/named.localhost /var/named/westos.com.zone         ##复制模板

wKioL1kQNBjg58HqAABS0H-eRyU766.png

vim westos.com.zone                            ##修改文件

wKioL1kQNFqDDTtfAAAcnSoMUA8307.png 


wKiom1kQNLqgOZl2AABiTWiT_rk621.png

NS : 域名的名称服务器

A : 名称至 IPv4 地址

CNAME : 名称至 ” 规范名称 “ ( 包含 A/AAAA 记录的另一个名称 )

MX : 用于名称的邮件交换器 ( 向何处发送其电子邮件 ) 1表示等级

   

systemctl restart named                        ##重启服务

 

wKiom1kQNZSjifIWAAChXYNUQDE247.png

wKiom1kQNa2gYJbyAAEFTBAb1Ro525.png

wKioL1kQNcqT-bmEAADV7W16BXM401.png

vim /etc/named.rfc1912.zones  ##修改配置文件

wKioL1kQR3GiF__BAAAlx58DleY055.png

cp -p /var/named/named.loopback /var/named/westos.com.ptr

wKiom1kQR9DxX54bAABbtaTJma0328.png

/var/named/westos.com.ptr  

wKiom1kQSDCQmeIkAAA6FOkQlis639.png


systemctl restart named                          ##重启服务

wKioL1kQSH3jok-vAAC5mkJJnTc369.png

 

不同IP的解析

设置两个IP

wKioL1kQNifBi0RdAAEnXORjuBA632.png

wKioL1kQNkyz_Ou0AACp95z_000777.png 

cp -p /etc/named.frc1912.zones /etc/named.frc1912.inter

cp -p /var/named/westos.com.zone /var/named/westos.com.inter  ##复制模板

wKioL1kQNpiCffDAAABPCRUMwy4202.png

vim /etc/nmaed.conf  

wKiom1kQNtPwHlQ1AABNvicbwXM618.png

vim /etc/named.frc1912.inter

vim /var/named/westos.com.inter

systemctl restart named    

wKiom1kQN_yxXkSQAAAjDkrrVd8786.png  

wKiom1kQOCni7eJjAAA1l4ftKqk236.png


wKioL1kQOJWDrUmjAADCVfKZYS8275.png

wKioL1kQOHbCXMkuAAE7EkOcWEg617.png

 

反向解析

cp -p /var/named/westos.com.zone /mnt                ##备份文件

wKioL1kQORuAj7egAAAazb9MMww005.png

vim /etc/named.frc1912.zone

wKiom1kQOaTw9Ne-AAAj3ssPRJs316.png

chmod 770 /var/named/

setsebool -P named_write_master_zones 1              

systemctl restart named

wKiom1kQQu2zfYSiAABCvfxj52I955.png

wKioL1kQQxriUWrpAAA0rRygTbE519.png

dns加密

dnssec-keygen -a HMac-MD5 -b 128 -n HOST westoskey           ##生成加密文件

wKioL1kQRDCyD5_rAAAvBvC7fMA252.png

cp -p /etc/rndc.key  /etc/westos.key   ##复制模板

wKiom1kQRJjgFLvRAAAtKzuGAoo782.pngv

vim  /etc/westos.key 

wKioL1kQRN6DhTS5AAAawxkU3fY628.png

vim /etc/named.conf

wKiom1kQRTiy7QQvAAAfzABLmIU907.png

vim /etc/named.frc1912.zones

wKiom1kQRcvzWfaqAAAjyP0Gz_k060.png

systemctl restart named 

wKioL1kQRi6Q0XitAABcdthKxIc909.png

wKioL1kQRk6RBd0SAABqlddFT9A835.png

动态dns解析

yum install dhcp -y                            ##安装服务

wKioL1kRl0aywDcdAAFEsKzZCW8022.png

cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcpd/dhcpd.conf ##复制模板

wKioL1kRl2LTcbWkAAAaPlwMq84015.png   

vim /etc/dhcpd/dhcpd.conf 

wKioL1kRl43gtBSIAAAT9PUqBRI102.png

wKiom1kRl8CigcVrAABb4PWWh7c958.png

wKioL1kRl-mwe5jFAACLwa5AeCk834.png

systemctl restart dhcpd ##重启服务

设置网络模式为dhcp

wKiom1kRmHXhb6umAAD6zWy2jw8911.png


相关文章