DNS(Domain Name Server,域名服务器)是进行域名(domain name)和与之相对应的IP地址 (IP address)转换的服务器。DNS中保存了一张域名(domain name)和与之相对应的IP地址 (IP address)的表,以解析消息的域名。 域名是Internet上某一台计算机或计算机组的名称,用于在数据传输时标识计算机的电子方位(有时也指地理位置)。域名是由一串用点分隔的名字组成的,通常包含组织名,而且始终包括两到三个字母的后缀,以指明组织的类型或该域所在的国家或地区。
环境说明:
[root@centos7 ~]# yum install -y bind
…
已安装:
bind.x86_64 32:9.11.4-26.P2.el7_9.5
作为依赖被安装:
bind-export-libs.x86_64 32:9.11.4-26.P2.el7_9.5 bind-libs.x86_64 32:9.11.4-26.P2.el7_9.5 python-ply.noarch 0:3.4-11.el7
作为依赖被升级:
bind-libs-lite.x86_64 32:9.11.4-26.P2.el7_9.5 bind-license.noarch 32:9.11.4-26.P2.el7_9.5 dhclient.x86_64 12:4.2.5-82.el7.centos
dhcp-common.x86_64 12:4.2.5-82.el7.centos dhcp-libs.x86_64 12:4.2.5-82.el7.centos
完毕!
[root@centos7 etc]# cp named.conf named.conf.bak
[root@centos7 etc]# cd /var/named/
[root@centos7 named]# vim free-wlw.com.zone
…
[root@centos7 named]# cat free-wlw.com.zone
$TTL 1D
@ IN SOA dns.free-wlw.com. root.free-wlw.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS dns.free-wlw.com.
www IN A 192.168.0.132
love IN A 192.168.0.132
* IN A 192.168.0.132
132 IN PTR www.free-wlw.com.
132 IN PTR love.free-wlw.com.
[root@centos7 named]# chown named.named free-wlw.com.zone
[root@centos7 named]# named-checkconf /etc/named.conf
[root@centos7 named]# named-checkzone free-wlw.com free-wlw.com.zone
zone free-wlw.com/IN: loaded serial 0
OK
[root@centos7 named]# systemctl start named
[root@test1 ~]# yum install -y bind-utils
…
Dependency Updated:
bind-libs.x86_64 32:9.11.4-26.P2.el7_9.5 bind-libs-lite.x86_64 32:9.11.4-26.P2.el7_9.5
bind-license.noarch 32:9.11.4-26.P2.el7_9.5 dhclient.x86_64 12:4.2.5-82.el7.centos
dhcp-common.x86_64 12:4.2.5-82.el7.centos dhcp-libs.x86_64 12:4.2.5-82.el7.centos
Complete!
[root@test1 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.0.132
[root@test1 ~]# nslookup www.free-wlw.com
Server: 192.168.0.132
Address: 192.168.0.132#53
Name: www.free-wlw.com
Address: 192.168.0.132
[root@test1 ~]# nslookup www.baidu.com
Server: 192.168.0.132
Address: 192.168.0.132#53
Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 183.232.231.174
Name: www.a.shifen.com
Address: 183.232.231.172
/etc/named.conf配置文件是DNS服务器的主配置文件,option参数说明如下:
如果您发现该资源为电子书等存在侵权的资源或对该资源描述不正确等,可点击“私信”按钮向作者进行反馈;如作者无回复可进行平台仲裁,我们会在第一时间进行处理!
添加我为好友,拉您入交流群!
请使用微信扫一扫!