解决在hexo上github推送连接失败的问题
在国内,有时候使用 git clone 的速度实在太慢而让人难以承受,或者 git pull/git push 一点反应都没有,这里整理了一下解决方法,亲测有效。总的来说,这是因为 github.global.ssl.fastly.net 域名被限制了。只要找到这个域名对应的 ip 地址,然后在 hosts 文件中加上 ip–>域名 的映射,刷新 DNS 缓存便可。1.查找域名对应的 ip 地址 在网站 https://www.ipaddress.com/ 分别搜索 github.global.ssl.fastly.net 和 github.com 或者在本地的终端中如下键入: 123456789101112131415$ nslookup github.global.ssl.fastly.NetServer: 127.0.0.53Address: 127.0.0.53#53Non-authoritative answer:Name: github.global.ssl.fastly.NetAddress: 151.101.229.194$ nslookup github.comServer: 127.0.0.53Address: 127.0.0.53#53Non-authoritative answer:Name: github.comAddress: 13.229.188.59 修改 hosts 文件 Windows 上的 hosts 文件路径在: C:\Windows\System32\drivers\etc\hosts在 hosts 文件末尾添加两行1234567891011121314151617181920212223# Copyright (c) 1993-2009 Microsoft Corp.## This is a sample HOSTS file used by Microsoft TCP/IP for Windows.## This file contains the mappings of IP addresses to host names. Each# entry should be kept on an individual line. The IP address should# be placed in the first column followed by the corresponding host name.# The IP address and the host name should be separated by at least one# space.## Additionally, comments (such as these) may be inserted on individual# lines or following the machine name denoted by a '#' symbol.## For example:## 102.54.94.97 rhino.acme.com # source server# 38.25.63.10 x.acme.com # x client host# localhost name resolution is handled within DNS itself.# 127.0.0.1 localhost# ::1 localhost199.232.69.194 github.global.ssl.fastly.net Linux 的 hosts 文件路径在 /etc/hosts 中:1$ sudo vim /etc/hosts 刷新 DNS 缓存 windows1ipconfig /flushdns linux1$ sudo /etc/init.d/networking restart 参考文献解决linux上git clone速度慢的问题git clone速度太慢的解决办法 本文转载自解决 GitHub 的 host 域名被限制的问题