github图片打不开解决方案

github界面的图片打不开的原因是域名污染! 为什么会出现域名污染,这是一个深刻但不方便这里解说的问题。

 

解决方案(推荐第2种)

1、要么更换本地网络配置中的DNS服务器地址为国外DNS服务器,这导致本地电脑打开网站比较慢。

更换本地DNS地址是最好的方式,推荐一个离中国比较近的DNS服务器地址(位于美国西海岸):

74.82.42.42

一般的PC电脑可以设置两个DNS地址,国内的DNS地址114.114.114.144已经被污染了。如果设置两个DNS地址,一个国内,另外一个国外,还是会受到DNS污染影响。

如果只设置一个国外DNS地址,除非你已经FQ成功,否则打开很慢。

 

2、要么使用本地host方式直接映射到一个公网地址(推荐这种)

下面介绍一个host的方式(这个方式不够彻底,因为git的图片服务器域名很多):

打开ipaddress.com深入地址,输入域名(这些域名是通过检查git上图片链接地址得到)

raw.githubusercontent.com

camo.githubusercontent.com

查询这个域名在中国大陆没有被污染的国外地址。

或者直接打开如下链接

https://github.com.ipaddress.com/

https://github.com.ipaddress.com/www.github.com

https://githubusercontent.com.ipaddress.com/raw.githubusercontent.com
https://githubusercontent.com.ipaddress.com/gist.githubusercontent.com
https://githubusercontent.com.ipaddress.com/cloud.githubusercontent.com
https://githubusercontent.com.ipaddress.com/camo.githubusercontent.com
https://githubusercontent.com.ipaddress.com/avatars0.githubusercontent.com
https://githubusercontent.com.ipaddress.com/avatars1.githubusercontent.com
https://githubusercontent.com.ipaddress.com/avatars2.githubusercontent.com
https://githubusercontent.com.ipaddress.com/avatars3.githubusercontent.com
https://githubusercontent.com.ipaddress.com/avatars4.githubusercontent.com
https://githubusercontent.com.ipaddress.com/avatars5.githubusercontent.com
https://githubusercontent.com.ipaddress.com/avatars6.githubusercontent.com
https://githubusercontent.com.ipaddress.com/avatars7.githubusercontent.com
https://githubusercontent.com.ipaddress.com/avatars8.githubusercontent.com

 

修改windows下的host文件

C:\Windows\System32\drivers\etc\hosts

或者linux下host文件

/etc/hosts

添加如下一行:

199.232.28.133 raw.githubusercontent.com
199.232.68.133 gist.githubusercontent.com
199.232.28.133 cloud.githubusercontent.com
199.232.28.133 camo.githubusercontent.com
199.232.28.133 avatars0.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.68.133 avatars3.githubusercontent.com
199.232.68.133 avatars4.githubusercontent.com
199.232.68.133 avatars5.githubusercontent.com
199.232.68.133 avatars6.githubusercontent.com
199.232.68.133 avatars7.githubusercontent.com
199.232.68.133 avatars8.githubusercontent.com

 

大功告成,重启浏览器,打开github。。。

你会惊讶的发现还是打不开github图片,为什么?

小概率的情况下,可以正常打开github,大部分情况下还是不能打开!

 

因为一般的互联网民上网是在家里或者公司这类地方上网。从网络管控层面划分,属于普通互联网用户层,这层网络拓扑结构中,ZF部署了大量的审查,监测设备,包括DNS污染,TCP重置等等若干手段。

这个时候需要通过PPTP微PN(自行准备IDC机房服务器,自行搭建一套PPTPD服务器,自行部署这套开源微PN服务)连接到IDC服务器区域,这条线路几乎属于骨干网,没有那么多严厉的审查(但是依然上不了谷歌等网站)但可以正常打开github

也就是说,配合PPTP微PN加host解析方式就可以彻底流畅打开github,包括图片了。

 

为什么不用PPTP微PN直接FQ到外国,因为PPTP微PN和open微PN等都已经被ZF的IT从业者做了深度协议规则解析并过滤了。

监测系统会自动捕捉这类流量,并通过探测服务端来封锁FQ服务器,这个操作只会在网络数据流要出国的时候操作,在国内互访是不受影响的。

通过两层跳板,一级跳板在国内云服务器那,二级跳板在国外,二级跳板启用防火墙源地址过滤:

-A INPUT -p tcp -m state --state NEW -m tcp -s xxx.xxx.xx.xx --dport 27512 -j ACCEPT

最佳实践

分两步走:

1、 使用云服务器(阿里云,亚马逊云,微软云)搭建一套PPTP-微PN(有固定IP,shadow-socks server使用iptables做源地址过滤,只允许该云服务器连接shadow-socks端口和ssh端口,这种方式FQ无法探测到。);

2、电脑链接PPTP--微PN,然后启用shadow-socks代理FQ。

完美解决github图片不能正常显示问题。

 

posted @ 2020-03-05 00:31  狂奔的骆驼  阅读(7452)  评论(1编辑  收藏  举报