今天升级了一下服务器,然后执行 apt-get update
的时候报错。这里留个小笔记。
Err:1 http://mirrors.tencentyun.com/ubuntu bionic InRelease
Something wicked happened resolving 'mirrors.tencentyun.com:http' (-5 - No address associated with hostname)
Hit:2 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic InRelease
Err:4 http://mirrors.tencentyun.com/ubuntu bionic-security InRelease
Something wicked happened resolving 'mirrors.tencentyun.com:http' (-5 - No address associated with hostname)
Hit:3 https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu bionic InRelease
Err:5 http://mirrors.tencentyun.com/ubuntu bionic-updates InRelease
Something wicked happened resolving 'mirrors.tencentyun.com:http' (-5 - No address associated with hostname)
Reading package lists... Done
W: Failed to fetch http://mirrors.tencentyun.com/ubuntu/dists/bionic/InRelease Something wicked happened resolving 'mirrors.tencentyun.com:http' (-5 - No address associated with hostname)
W: Failed to fetch http://mirrors.tencentyun.com/ubuntu/dists/bionic-security/InRelease Something wicked happened resolving 'mirrors.tencentyun.com:http' (-5 - No address associated with hostname)
W: Failed to fetch http://mirrors.tencentyun.com/ubuntu/dists/bionic-updates/InRelease Something wicked happened resolving 'mirrors.tencentyun.com:http' (-5 - No address associated with hostname)
W: Some index files failed to download. They have been ignored, or old ones used instead.
找了一下原因,发现我本机ping
mirrors.tencentyun.com 也没能ping
通。
后来找到了这个资料
vim /etc/resolv.conf
nameserver 10.182.24.12
nameserver 10.182.20.26
mirrors.tencentyun.com 是内网域名,要用内网的DNS才能解析到
2018.12.15 更新 广州
vim /etc/resolv.conf
nameserver 10.59.218.193
nameserver 10.59.218.194