Docker Pull镜像时报错no such host

Lasted 2020-02-23 15:43:33

Docker Pull镜像时报如下错误信息:

ERROR: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.3.1:53: no such host

 其中 no such host 表示DNS域名解析的问题,编辑 /etc/resolv.conf 增加一行DNS记录,重新 Pull 镜像,问题解决。

vi /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.1
nameserver 8.8.8.8