1、DNS正向解析:根据域名查找对应的IP地址 DNS服务使用TCP和UDP的53端口,TCP的53端口用于连接DNS服务器,UDP的53端口用于解析DNS; 2、DNS服务器的类型: 1)、主域名服务器; 2)、从域名服务器; 3)、缓存域名服务器; 3、配置DNS的正向解析: 1、修改主配置文件: vim /etc/named.conf 2、修改区域配置文件,添加正向区域配置: vim named.rfc1912.zones : zone “dingning.com” IN { type master; file “dingning.com.zone”; allow-update { none; }; }; 3、配置正向区域数据文件: [root@localhost etc]# cd /var/named/
[root@localhost named]# cp -p named.localhost dingning.com.zone
[root@localhost named]# vim dingning.com.zone
[root@localhost named]# vim dingning.com.zone $TTL 1D @ IN SOA dingning.com. admin.dingning.com. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS dingning.com. A 192.168.233.131 IN MX 10 mail.dingning.com. www IN A 192.168.233.131 mail IN A 192.168.233.4 ftp IN CNAME www
- IN A 192.168.233.100
[root@localhost named]# systemctl start named 启动成功,配置完成!
在客户端的域名解析配置文件中添加DNS服务器地址: [root@localhost etc]# vim resolv.conf nameserver 192.168.233.129 [root@localhost ~]# systemctl restart named [root@localhost ~]# nslookup dingning.com Server: 192.168.223.131 Address: 192.168.223.131#53