linux搭建dns服务器安装_linux配置dns三种方式( 二 )

7.启动服务
[root@OpsNotenamed]#cat/etc/resolv.conf#GeneratedbyNetworkManagerdomainlocaldomainsearchlocaldomainnameserver192.168.68.135[root@OpsNotenamed]#systemctlstartnamed[root@OpsNotenamed]#firewall-cmd--add-service=dnssuccess[root@OpsNotenamed]#8.测试
在另外一台rhel 7(192.168.68.131)上面配置好DNS:192.168.68.135 。测试
[root@localhost~]#ifconfigens32ens32:flags=4163<UP,BROADCAST,RUNNING,MULTICAST>mtu1500inet192.168.68.131netmask255.255.255.0broadcast192.168.68.255inet6fe80::4c67:9a21:2e77:422aprefixlen64scopeid0x20<link>ether00:0c:29:56:1a:03txqueuelen1000(Ethernet)RXpackets1674bytes1732919(1.6MiB)RXerrors0dropped0overruns0frame0TXpackets607bytes70284(68.6KiB)TXerrors0dropped0overruns0carrier0collisions0[root@localhost~]#[root@localhost~]#cat/etc/resolv.conf#GeneratedbyNetworkManagersearchlocaldomainnameserver192.168.68.135[root@localhost~]#ping192.168.68.135-c1PING192.168.68.135(192.168.68.135)56(84)bytesofdata.64bytesfrom192.168.68.135:icmp_seq=1ttl=64time=1.60ms---192.168.68.135pingstatistics---1packetstransmitted,1received,0%packetloss,time0msrttmin/avg/max/mdev=1.609/1.609/1.609/0.000ms[root@localhost~]#nslookupwww.opsnote.comServer:192.168.68.135Address:192.168.68.135#53Name:www.opsnote.comAddress:192.168.10.201[root@localhost~]#nslookupftp.opsnote.comServer:192.168.68.135Address:192.168.68.135#53Name:ftp.opsnote.comAddress:192.168.10.202[root@localhost~]#[root@localhost~]#nslookupns.opsnote.comServer:192.168.68.135Address:192.168.68.135#53Name:ns.opsnote.comAddress:192.168.10.135[root@localhost~]#

推荐阅读