github解决加载缓慢问题

通过修改hosts文件来提速

获取github的IP地址

  1. 点击这里 依次获取以下三个网址的IP
  • github.com
  • github.global.ssl.fastly.net
  • codeload.github.com
  • 在这里插入图片描述

    3. 获取到的IP,其实不用第一步.直接使用以下的ip地址
    192.30.253.113 github.com
    151.101.25.194 github.global.ssl.fastly.net
    192.30.253.121 codeload.github.com
    

    修改系统hosts

    192.30.253.113  github.com
    151.101.25.194 github.global.ssl.fastly.net
    192.30.253.121 codeload.github.com
    

    windows系统

    • hosts文件路径:C:\Windows\System32\drivers\etc\hosts ,
    • 添加上面查询到的IP到hosts文件中(此时可能需要管理员权限,可以将hosts复制到桌面,修改好了再复制回去覆盖原先的)
    • 结果:
      在这里插入图片描述
    • 刷新DNS
    ipconfig /flushdns
    
    • 恭喜完成!!!

    linux系统

    • 打开hosts文件并修改
    sudo vim /etc/hosts
    
    • 插入ip映射保存退出
      结果:
      在这里插入图片描述
    • 重启网络服务
    sudo /etc/init.d/networking restart
    

    恭喜完成!!!

    发布了20 篇原创文章 · 获赞 26 · 访问量 1万+

    猜你喜欢

    转载自blog.csdn.net/jianming21/article/details/93402200