未能解析此远程名称:'nuget.org' 的解决方法

今天用Nuget下一个程序包时,发现Nuget挂了: 未能解析此远程名称:'nuget.org' 。

浏览器打开  http://nuget.org  失败。

使用cmd命令 输入nslookup nuget.org 解析失败

使用Google的DNS 输入 nslookup nuget.org 8.8.8.8 解析成功

如:

  服务器: google-public-dns-a.google.com
  Address: 8.8.8.8

  非权威应答:
  名称: nuget.org
  Address: 157.56.8.189

这时将解析出来的IP地址 和nuget.org写入到 %system%/system32/drivers/etc中的hosts文件中

格式: IP地址 域名

157.56.8.189 nuget.org

注:一定要写入自己电脑上解析出来的IP地址。

本人一开始写入的是 从网上copy来的Ip地址,结果依然解析失败,不知道是IP地址失效还是过期了

原文地址:https://www.cnblogs.com/jsonzheng/p/3788135.html