dns 污染: 无法 curl / wget raw.githubusercontent.com

解决方法

进入  https://site.ip138.com/raw.Githubusercontent.com/解析 raw.githubusercontent.com 的 ip

如果是linux系统,则修改hosts文件,将ip对应域名加入即可,我这里查到的ip是185.199.109.133

$ sed -i '$a\185.199.109.133 raw.githubusercontent.com' /etc/hosts

vi /etc/hosts
###增加下面的解析
199.232.68.133 raw.githubusercontent.com

Windows 设置见下面。

----------------------------------------------------------------

无法wget raw.githubusercontent.com  无法wget raw.githubusercontent.com-腾讯云开发者社区-腾讯云 

raw.githubusercontent.com出现refusedcentos7 wget 去https://raw.githubusercontent.com https://blog.51cto.com/smallfa/5159596    

raw.githubusercontent.com出现refusedcentos7 wget 去https://raw.githubusercontent.com https://blog.51cto.com/smallfa/5159596    

今天升级了一台自己的服务器,使用let’s encrypt 配置https,curl 安装 ​​acme.sh​​的时候报错。

具体的错误信息如下:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: 拒绝连接

查询了一下发现是 dns 污染的问题,设置直连 

vi /etc/hosts
###增加下面的解析
199.232.68.133 raw.githubusercontent.com

​​centos7 wget 去https://raw.githubusercontent.com 获取flannel.yml文件报错:Unable to establish SSL connection​​

无法wget raw.githubusercontent.com

  https://cloud.tencent.com/developer/article/2170927 

实测:在Debian OK。

在我们使用github中的一些文件需要下载时,尤其是使用脚本的时候,希望使用wget可以拿取github中的单个文件,gihub有这个功能,需要访问raw.githubusercontent.com,但是当使用时,会出现如下这样的问题

代码语言:javascript

复制

Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 0.0.0.0, ::
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443... failed: Connection refused.
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|::|:443... failed: Connection refused.

解决方法

点击进入该网站  https://site.ip138.com/raw.Githubusercontent.com/,解析raw.githubusercontent.com的ip

如果是linux系统,则修改hosts文件,将ip对应域名加入即可,我这里查到的ip是185.199.109.133

代码语言:javascript

复制

$ sed -i '$a\185.199.109.133 raw.githubusercontent.com' /etc/hosts

如果是windows无法访问该页面,也可以添加,hosts路径为C:\Windows\System32\drivers\etc\hosts,与linux格式一样,然后就可以访问了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值