Editing the DNS nameserver in /etc/resolv.conf
file helped me.
编辑/etc/Resolv.conf文件中的域名服务器对我很有帮助。
Change your existing nameserver to google nameserver i.e., x.x.x.x to 8.8.8.8
将您现有的名称服务器更改为Google名称服务器,即,x.x.x.x到8.8.8.8
Comment your nameserver IP and add something like this :
注释您的域名服务器IP并添加如下内容:
#nameserver x.x.x.x
nameserver 8.8.8.8
should work.
应该行得通。
If you are behind a proxy, this could be your issue. In this case, you need to configure the Docker daemon (not the client) proxy settings. You can do that by:
如果你是代理人的幕后黑手,这可能是你的问题。在这种情况下,您需要配置Docker守护进程(而不是客户端)代理设置。您可以通过以下方式做到这一点:
- Create a systemd drop-in directory for the docker service:
sudo mkdir -p /etc/systemd/system/docker.service.d
- Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
- Flush changes
sudo systemctl daemon-reload
- Restart docker daemon
sudo systemctl restart docker
Reference: Docker documentation.
参考:Docker文档。
In my case, it was because of a typo mistake.
在我的案例中,这是因为一个打字错误。
I wrote for example:
例如,我写道:
my-registryhob.mydomain.com
My-registryhob.mydomain.com
instead of:
不是:
my-registryhub.mydomain.com
My-registryhub.mydomain.com
Check for typo mistake..
检查打字错误..
I was running into this issue because we had a private module and I didn't configure private module environment variables.
Adding these fixed my issue:
我遇到这个问题是因为我们有一个私有模块,而我没有配置私有模块环境变量。添加这些解决了我的问题:
export GOPRIVATE="*.company.com"
export GOPROXY=athens.company.com
export GONOSUMDB="*.company.com"
More details at: https://go.dev/ref/mod#private-modules
更多详情请访问:https://go.dev/ref/mod#private-modules
Seems like the domain name which you are using for your private repo is expired, that is why it is not resolving through global DNS 8.8.8.8 . Check with your Domain name provider.
您用于私人回购的域名似乎已过期,这就是为什么它不能通过全局DNS 8.8.8.8进行解析的原因。请咨询您的域名提供商。
Had the same error, and my problem was that I mistyped the registry url puting '.co' instead of '.com' at the end of host:
我也犯了同样的错误,我的问题是我错误地输入了注册表URL,在主机的末尾输入了‘.co’而不是‘.com’:
What I wrongly typed: *********.dkr.ecr.us-east-2.amazonaws.co
我输入错误的内容:*.dkr.ecr.us-East-2.amazonaws.co
What shold be: *********.dkr.ecr.us-east-2.amazonaws.com
应该是:*.dkr.ecr.us-East-2.amazonaws.com
Causing to be a host that really doesn't exist. Always check it twice.
导致成为一个实际上并不存在的宿主。一定要检查两次。
Facing the same issue dial tcp: lookup abc.com on 127.0.0.11:53: no such host
.
面对同样的问题,请在127.0.0.11:53拨打tcp:lookup abc.com:没有这样的主机。
Issue resolved when
问题解决,
Turn off the VPN
更多回答
That did indeed work...thank you. Any idea why Google Cloud Shell is configured with a different nameserver than 8.8.8.8? The nameserver that is configured in resolve.conf by default is unreachable.
这确实奏效了……谢谢。知道为什么Google Cloud Shell配置了与8.8.8.8不同的名称服务器吗?默认情况下,在解决方案.conf中配置的名称服务器是无法访问的。
I had this issue when creating a cluster on kubernetes and know it's resolved with this answer.
当我在Kubernetes上创建集群时,我遇到了这个问题,我知道这个问题已经通过这个答案解决了。
I had this issue using Doppler. it works like a charm
我在用多普勒的时候遇到了这个问题。它的作用就像一种护身符
我是一名优秀的程序员,十分优秀!