Visual Studio无法解析nuget的解决方法

  VS在使用nuget进行程序包管理时,经常出现“未能解析此远程名称:'nuget.org'”的情况,但是访问http://www.nuget.org/时正常。此时,可通过如下几种方式测试:

1、使用默认的本地DNS进行解析:在命令行下输入:nslookup nuget.org,如果解析出地址

C:\WINDOWS\system32>nslookup nuget.org 8.8.8.8
服务器: google-public-dns-a.google.com
Address: 8.8.8.8

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

  将ip地址添加到host中去。(host目录位置:C:\Windows\System32\drivers\etc )

2、使用google的OpenDNS 8.8.8.8或8.8.4.4,解析nuget.org

C:\WINDOWS\system32>nslookup nuget.org 8.8.8.8
DNS request timed out.
timeout was 2 seconds.
服务器: UnKnown
Address: 8.8.8.8

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

同样的,获取ip添加到host中去。

3、直接使用google的OpenDNS 8.8.8.8或8.8.4.4替换本机的DNS,将本机的DNS服务器地址由自动获取改为“8.8.8.8或8.8.4.4”,可也添加为备用 DNS。

4、使用其他OpenDNS替换本机默认DNS,以下提供一些免费的域名解析服务提供商:

208.67.222.222 (Resolver1.OpenDNS.com)

208.67.220.220 (Resolver2.OpenDNS.com)

208.67.222.220 (Resolver3.OpenDNS.com)

208.67.220.222 (Resolver4.OpenDNS.com)

OpenDNS还有另一个服务Family shield Server ,可以阻挡成人网站以及含有恶意软件的网站。

208.67.222.123 (resolver1-fs.opendns.com)

208.67.220.123 (resolver2-fs.opendns.com)

  以上部分内容来源于网络,经测试后整理。

转载于:https://www.cnblogs.com/elic/p/4063887.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值