dial tcp: lookup index.docker.io: no such host

场景:本想从网上search 一个docker image 结果报错, 
[root@docker log]# docker  search mysql
FATA[0005] Error response from daemon: Get https://index.docker.io/v1/search?q=mysql: dial tcp: lookup index.docker.io: no such host 
前几天用的好好的,没修改过任何的东西,为毛no  such host,
于是ping   index.docker.io  果然解析不了
但是在同一个机器上,ping www.baidu.com 能正常解析,显然机器的配置没问题,有可能是域名别GWF给封掉了!在xinnet做虚拟主机的时候遇到过这样的问题!
解决方法:
找一台国外的机器,测试下ping  index.docker.io
我的显示如下:
[root@vultr ~]# ping index.docker.io
PING us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws. (52.3.72.117) 56(84) bytes of data.
^C
--- us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws. ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4364ms


[root@vultr ~]# index.docker.io
-bash: index.docker.io: command not found
[root@vultr ~]# ping index.docker.io
PING us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws. (54.88.253.98) 56(84) bytes of data.
^C
--- us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws. ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3163ms

显然这个域名是做的cdn加速的,不管了,我在自己本地的/etc/hosts文件里面加入一条记录:
然后就可以正常显示了,见附件

dial tcp: lookup index.docker.io: no such host_第1张图片


转载于:http://blog.chinaunix.net/uid-20776139-id-5180853.html

你可能感兴趣的:(docker)