### --- 重启DNS服务
service named restart
### --- 客户端测试
~~~ 在网卡配合文件中添加DNS服务器的地址,然后用nslookup测试。
二、DNS服务搭建:实验专题.DNS基本功能的实现
### --- 实验专题.DNS基本功能的实现
~~~ centos6.x-server1:192.168.1.21 20.20.20.21 DNS server
~~~ centos6.x-server2:192.168.1.22 20.20.20.22 DNS client
~~~ centos6.x-server3:192.168.1.23 20.20.20.23 web server
centos6.x-server3:192.168.1.23 20.20.20.23 web server
### --- centos6.x-server3:192.168.1.23 20.20.20.23 web server
### --- 安装Apache并设置启动文件
[root@server23 ~]# yum install -y httpd
[root@server23 ~]# vim /var/www/html/index.html
This is DNS web-server 20.20.20.23
[root@server23 ~]# service httpd restart
### --- 验证Apache:以下两个命令都可以测试
[root@server21 ~]# elinks 192.168.1.23
This is DNS web-server 20.20.20.23
[root@server21 ~]# curl 192.168.1.23
This is DNS web-server 20.20.20.23
centos6.x-server1:192.168.1.21 20.20.20.21 DNS server
centos6.x-server2:192.168.1.22 20.20.20.22 DNS client
### --- centos6.x-server2:192.168.1.22 20.20.20.22 DNS client
### --- 客户端测试
[root@server22 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DNS1=192.168.1.21
[root@server22 ~]# elinks www.atyanqi.com // 客户端访问没有任何内容
[root@server22 ~]# service network restart // 重启之后可以正常解析
[root@server22 ~]# elinks www.atyanqi.com
This is DNS web-server 20.20.20.23
[root@server22 ~]# curl www.atyanqi.com
This is DNS web-server 20.20.20.23
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart ——W.S.Landor