今天在Ubuntu
上下载来自github
的某文件时,出现如下报错:
--2020-06-30 23:08:28-- https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/linuxgsm.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 0.0.0.0, ::
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443... failed: Connection refused.
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|::|:443... failed: Connection refused.
但是访问或下载其他网站文件时正常,于是ping
一下该网址:ping
,发现指向127.0.0.1
,这显然是错误的。猜测是DNS配置出现问题,编辑/etc/resolv.conf
原文件是:
servername 127.0.0.53
options edns0
更改servername
可解决问题,你可以改为:
servername 233.5.5.5
servername 1.0.0.1
options edns0
然后重启服务:
systemd resolved.service restart
再次ping
该网址,正常,再次尝试下载文件,正常,问题解决。