1、systemctl disable firewalld 关闭防火墙
2、yum install bind*
[root@d-mysql ~]# which nslookup
/usr/bin/nslookup
[root@d-mysql ~]# rpm -qf /usr/bin/nslookup
bind-utils-9.11.4-26.P2.el7_9.14.x86_6
[root@d-mysql ~]# service named start
Redirecting to /bin/systemctl start named.service
[root@d-mysql ~]# systemctl enable named
Created symlink from /etc/systemd/system/multi-user.target.wants/named.service to /usr/lib/emd/system/named.service.
vim /etc/resolv.conf
将内容修改为:
# Generated by NetworkManager
#nameserver 114.114.114.114
nameserver 127.0.0.1
测试:
[root@d-mysql ~]# nslookup
> www.qq.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
www.qq.com canonical name = ins-r23tsuuf.ias.tencent-cloud.net.
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 121.14.77.201
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 121.14.77.221
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 240e:97c:2f:2::4c
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 240e:97c:2f:1::5c
达到上述效果即成功