zoukankan      html  css  js  c++  java
  • 最近的github又不稳了。。ip host 大法来

    结果:

    140.82.113.4 github.com
    13.229.188.59 github.com
    13.114.40.48 github.com
    185.199.110.153 github.com
    185.199.111.153 github.com
    185.199.109.153 github.com
    185.199.108.153 github.com
    66.220.147.11 fastly.net
    203.208.39.99 fastly.net
    104.244.46.85 fastly.net
    199.232.69.194 fastly.net
    185.199.110.133 githubusercontent.com
    185.199.108.133 githubusercontent.com
    185.199.109.133 githubusercontent.com
    185.199.111.133 githubusercontent.com

    https://www.ipaddress.com/search/

    http://tool.chinaz.com/dns/

    过程:【最新】解决Github网页上图片显示失败的问题

    一、问题

    比如随便打开一个项目,图片都不能显示了,我头像也没了,真是一个令人伤心的事
    在这里插入图片描述
    F12打开控制台看一哈
    在这里插入图片描述
    呦,一堆红色×。主要报错是Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID

    去查了一下,博主john-zeng这样解释道:

    实际上,可以认为,ERR_CERT_COMMON_NAME_INVALID就是用一个错误的域名访问了某个节点的https资源。导致这个错误的原因,基本是:

    1. dns污染
    2. host设置错误
    3. 官方更新了dns,但是dns缓存没有被更新,导致错误解析。

    我觉得像是有点道理,解决方法就粗来了,hin简单,往下看。

    二、解决方法

    主要思路就是使用本地hosts文件对网站进行域名解析,一般的DNS问题都可以通过修改hosts文件来解决,githubCDN域名被污染问题也不例外,同样可以通过修改hosts文件解决,将域名解析直接指向IP地址来绕过DNS的解析,以此解决污染问题。

    2.1 找到URL

    打开github任意未显示图片的网页,使用元素选择器(Ctrl+Shift+C)放在显示不了的图片上,或者在无法显示的图片上右键-检查元素,定位到该图片的标签,那么你得到了它的URL,叫做src属性。

    比如介个在这里插入图片描述
    在右面把它的网址复制粗来:

    https://avatars2.githubusercontent.com/u/15832957?s=60&v=4

    2.2 获取IP地址

    得到上述网址以后打开IPAddress.com这个网站,在搜索框输入它的域名,就是https://com那一部分,俗称二级域名:

    avatars2.githubusercontent.com
    在这里插入图片描述
    回车!!!下面你会看到该域名的信息和IP地址:
    在这里插入图片描述
    可以看出IP是:151.101.184.133,并且是2019.05.05最后更新的,alright,那么我们就可以使这个IP和域名映射起来。

    (其他如果有挂掉的图片一样使用此方法进行一一映射即可。)

    2.3 修改hosts

    具体咋映射呢?修改hosts文件!!!本人使用的是windows系统,所以使用Sublime Text打开:C:WindowsSystem32driversetchosts

    在文件末尾添加:
    在这里插入图片描述

    可以直接选中以下内容复制粘贴,20210119有效(包括MAC系统)20210123更新

    # GitHub Start 
    140.82.113.3      github.com
    140.82.114.20     gist.github.com
    
    151.101.184.133    assets-cdn.github.com
    151.101.184.133    raw.githubusercontent.com
    199.232.28.133     raw.githubusercontent.com 
    151.101.184.133    gist.githubusercontent.com
    151.101.184.133    cloud.githubusercontent.com
    151.101.184.133    camo.githubusercontent.com
    199.232.96.133     avatars.githubusercontent.com
    151.101.184.133    avatars0.githubusercontent.com
    199.232.68.133     avatars0.githubusercontent.com
    199.232.28.133     avatars0.githubusercontent.com 
    199.232.28.133     avatars1.githubusercontent.com
    151.101.184.133    avatars1.githubusercontent.com
    151.101.108.133    avatars1.githubusercontent.com
    151.101.184.133    avatars2.githubusercontent.com
    199.232.28.133     avatars2.githubusercontent.com
    151.101.184.133    avatars3.githubusercontent.com
    199.232.68.133     avatars3.githubusercontent.com
    151.101.184.133    avatars4.githubusercontent.com
    199.232.68.133     avatars4.githubusercontent.com
    151.101.184.133    avatars5.githubusercontent.com
    199.232.68.133     avatars5.githubusercontent.com
    151.101.184.133    avatars6.githubusercontent.com
    199.232.68.133     avatars6.githubusercontent.com
    151.101.184.133    avatars7.githubusercontent.com
    199.232.68.133     avatars7.githubusercontent.com
    151.101.184.133    avatars8.githubusercontent.com
    199.232.68.133     avatars8.githubusercontent.com
    199.232.96.133     avatars9.githubusercontent.com
    
    # GitHub End
    

    然后保存文件就OK了,至于无法保存,没有修改权限,鼠标右键-属性-安全-修改权限;或将hosts文件复制一份,修改之后,复制到原文件夹替换!

    三、最后说几句

    还可以使用ipconfig/flush对本地DNS缓存进行一次刷新,如果遇到网络异常,可能是DNS缓存的问题,刷新一下,步骤。

    1. windows开始→运行→输入:CMD 按回车键,打开命令提示符窗口。
    2. 再输入: ipconfig /flushdns 回车,执行命令,可以重建本地DNS缓存。

    再附上几个命令:

    ipconfig /displaydns # 显示dns缓存 
    
    ipconfig /flushdns # 刷新DNS记录 
    
    ipconfig /renew # 重请从DHCP服务器获得IP 
    

    PS:另外要注意的一点就是,如果图片再次不能显示,只需要及时更新IP就行啦,这波操作不麻烦,你看我头像回来了!!!

    https://blog.csdn.net/qq_38232598/article/details/91346392

    如何快速访问github(简单易懂)

    一、

        经常访问github,网络卡顿让人难以接受,上网搜集了一下资料,结合自己的经验,分享给大家。

    二、

        1、打开DNS查询工具:http://tool.chinaz.com/dns

         2、查询步骤如下:选择TTL值较低的,如果当前列表没有否和要求的IP,重新检测。

        3、找到host文件,将找到的IP按照下面的格式放入Host文件保存,访问就提速了。 

    #13.229.188.59 https://github.com

    如下: 

    三、用命令查找host文件,请参考http://www.bigbaicai.com/dnkt/4049.html

    =========================

    工作机会(内部推荐):发送邮件至gaoyabing@126.com,看到会帮转内部HR。

    邮件标题:X姓名X_X公司X_简历(如:张三_东方财富_简历),否则一律垃圾邮件!

    公司信息:

    1. 1.东方财富|上海徐汇、南京|微信客户端查看职位(可自助提交信息,微信打开);
  • 相关阅读:
    HDU 4069 Squiggly Sudoku
    SPOJ 1771 Yet Another NQueen Problem
    POJ 3469 Dual Core CPU
    CF 118E Bertown roads
    URAL 1664 Pipeline Transportation
    POJ 3076 Sudoku
    UVA 10330 Power Transmission
    HDU 1426 Sudoku Killer
    POJ 3074 Sudoku
    HDU 3315 My Brute
  • 原文地址:https://www.cnblogs.com/Chary/p/14506162.html
Copyright © 2011-2022 走看看