问题遇到的现象和发生背景
OS版本:CentOS Linux release 7.6.1810 (Core)
问题相关代码,请勿粘贴截图
使用curl和wget验证也解析失败
[root@localhost ~]# curl https://www.cnblogs.com/passer101/p/9899202.html
curl: (6) Could not resolve host: www.cnblogs.com; Name or service not known
[root@localhost ~]# wget https://www.cnblogs.com/passer101/p/9899202.html
--2021-12-22 18:20:25-- https://www.cnblogs.com/passer101/p/9899202.html
Resolving www.cnblogs.com (www.cnblogs.com)... failed: Name or service not known.
wget: unable to resolve host address ‘www.cnblogs.com’
运行结果及报错内容
ping: www.baidu.comm: Name or service not known
我的解答思路和尝试过的方法
尝试关闭NetworkManage,问题依旧
尝试安装bind,问题依旧
网卡配置:
[root@localhost ~]# more /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens32
UUID=65fb1b6d-055e-4826-a1e4-1c2feb6c60ad
DEVICE=ens32
ONBOOT=yes
IPADDR=xxxxxxxxxxxxxx
PREFIX=24
GATEWAY=xxxxxxxxxxx
ARPCHECK=no
DNS1=211.139.80.6
DNS2=218.203.160.194
resolv配置:
[root@localhost ~]# more /etc/resolv.conf
# Generated by NetworkManager
nameserver 211.139.80.6
nameserver 218.203.160.194
host解析:
[root@localhost log]# host www.baidu.com
www.baidu.com is an alias for www.a.shifen.com.
www.a.shifen.com has address 39.156.66.18
www.a.shifen.com has address 39.156.66.14
nslookup解析:
[root@localhost log]# nslookup www.baidu.com
Server: 218.203.160.194
Address: 218.203.160.194#53
Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 39.156.66.18
Name: www.a.shifen.com
Address: 39.156.66.14
我想要达到的结果
能够正常解析域名