- shell中输入:
nslookup github.global.ssl.fastly.Net
输出:
[chenhanxuan@idiospace ~]$ nslookup github.global.ssl.fastly.Net
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name: github.global.ssl.fastly.Net
Address: 208.43.237.140 // 有用数据addr1
- shell中输入:
nslookup github.com
输出:
[chenhanxuan@idiospace ~]$ nslookup github.com
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name: github.com
Address: 13.250.177.223 // 有用数据addr2
- 将以上两个有用的数据添加到系统hosts目录中
Ubuntu: sudo vim /etc/hosts
MacOS: sudo vi /etc/hosts
Win: 打开文件C:\Windows\System32\drivers\etc\hosts,手工修改
以上文件末尾添加两行:
github.com 13.250.177.223
github.global.ssl.fastly.Net 208.43.237.140
- 保存退出
- 刷新DNS缓存
Ubuntu: sudo /etc/init.d/networking restart
MacOS: ipconfig /flushdns
Win: sudo killall -HUP mDNSResponder