[Desktop] ping的通IP,但无法解析域名
Tofloor
poster avatar
剑心
deepin
2023-05-27 00:22
Author

ping的通IP地址,却不能解析域名,应该还是linux系统本身的问题,请大神看下
微信图片_202305261335523.jpg

微信图片_202305261335522.jpg

微信图片_202305261335521.jpg

微信图片_20230526133553.jpg

微信图片_20230526133551.jpg

Reply Favorite View the author
All Replies
jjcui8595
Moderator
2023-05-27 00:56
#1

没有发现这个问题,确认你的域名服务器正确,可以设成8.8.8.8试试

Reply View the author
蔡EEPIN
deepin
2023-05-27 01:02
#2

dns服务器地址换一个 114.114.114.114

Reply View the author
安洛
deepin
2023-05-27 01:12
#3

试试

ping baidu.com

看看解析出来的ip是啥。

Reply View the author
剑心
deepin
2023-05-27 01:54
#4
安洛

试试

ping baidu.com

看看解析出来的ip是啥。

无法解析

Reply View the author
剑心
deepin
2023-05-27 01:55
#5
蔡EEPIN

dns服务器地址换一个 114.114.114.114

都试过了,没用,绝对不是域名服务器的问题

Reply View the author
剑心
deepin
2023-05-27 01:55
#6
jjcui8595

没有发现这个问题,确认你的域名服务器正确,可以设成8.8.8.8试试

试过了,没用

Reply View the author
安洛
deepin
2023-05-27 02:17
#7
剑心

无法解析

是没有任何返回结果吗?

安装dnsutils软件包,然后用 nslookup baidu.com试试?

Reply View the author
berners
deepin
2023-05-27 02:25
#8
安洛

是没有任何返回结果吗?

安装dnsutils软件包,然后用 nslookup baidu.com试试?

他没网怎么安装😂

Reply View the author
安洛
deepin
2023-05-27 02:45
#9
berners

他没网怎么安装😂

用ip地址访问http或ftp协议的debian仓库下载。或者手机上下软件包传到电脑上装也行。

Reply View the author
希声
deepin
2023-05-27 02:57
#10

你dns用,192.168.1.1 试试,用路由器提供的dns

Reply View the author
2023开始学习
deepin
2023-05-27 03:47
#11

重启就能解决。我遇到过ping路由器和127.0.0.1都ping不通的。

Reply View the author
berners
deepin
2023-05-27 04:07
#12

除了公寓的静态ip,一般家用的都可以不设置ip地址

Reply View the author
落日
deepin
2023-05-27 05:13
#13

看看是不是手动设置的ip和其他设备冲突导致

Reply View the author
W2J
deepin
2023-05-27 06:45
#14

现在的虚拟化很流行,ns(命名空间)机制开始对域名有了更多应用和要求。

看看下面的举例,注意第二行127.0.1.1,要和主机名一致

w2j@u22lts:$ head -n2 /etc/hosts
127.0.0.1 localhost loopback localhost.localdomain
127.0.1.1 u22lts
w2j@u22lts:$

Reply View the author
deepinuser17
deepin
2023-05-27 07:39
#15

查看一下机器的系统设置:

grep ^hosts /etc/nsswitch.conf
cat /etc/resolv.conf

根据截屏, 目前系统设置有两个域名服务器地址, 61.177.7.1, 180.76.76.76.

本机能否连接到这两个IP地址是关键. 首先测试一下是否可以ping.

ping 61.177.7.1
ping 180.76.76.76

如果可以ping, 测试直接使用该IP地址来解析域名:

dig @61.177.77.1  www.baidu.com
dig @180.76.76.76 www.baidu.com

注意有时候域名服务器是被禁止非本地机器ping的. 不能ping, 不一定说明不提供域名解析服务.

如果以上命令无法解析www.baidu.com, 说明要么本机无法连接这些域名服务器, 要么这些服务器限制可以使用的用户机器.

一般网关都会提供域名解析服务. 另外要用向公众公开提供域名解析服务的服务器来测试.

Reply View the author
deepinuser17
deepin
2023-05-27 07:41
#16

运行这个命令查看网关是否提供域名服务:

dig @192.168.1.1 www.baidu.com
Reply View the author