在日常工作维护时收到客户反馈服务器无法访问网站的问题,经过初期测试发现nslookup
命令能够解析DNS地址,但其他命令无法识别resolve配置。
[root@281 ~]# curl www.qq.com
curl: (6) Couldn't resolve host 'www.qq.com'
[root@281 ~]# wget www.qq.com
--2022-11-09 13:39:57-- http://www.qq.com/
Resolving www.qq.com... failed: Name or service not known.
wget: unable to resolve host address `www.qq.com'
[root@281 ~]# nslookup www.qq.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
`Non-authoritative answer:
www.qq.com canonical name = ins-r23tsuuf.ias.tencent-cloud.net.
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 42.81.176.157
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 42.81.179.153`
解决办法
如果在网卡配置中未配置DNS信息,则需手动配置DNS信息。
通过排查,是由于NetworkManager服务未启动导致的问题,启动服务后恢复正常。
[root@281 ~]# service NetworkManager status
NetworkManager is stopped
[root@281 ~]# service NetworkManager start
Setting network parameters... [ OK ]
Starting NetworkManager daemon: [ OK ]