当前位置: 首页 > article >正文

github通过修改hosts访问

        ubuntu系统下,常常因为国内网络原因无法访问github官网或者也无法使用使用git clone指令,搭建梯子又过于复杂,可使用修改hosts文件,添加IP地址的方法改进。

修改Hosts文件:

1、打开DNS查询网站:DNS查询。站长工具 - 站长之家

        也可通过工具查看DNS:

nslookup github.com
nslookup github.global.ssl.fastly.net 

2、输入github域名:http://github.com,点击检测。

3、选择合适的IP地址,复制。

4、将IP地址复制到Hosts文件中。

#打开Hosts文件 
sudo gedit /etc/hosts 

# 添加IP地址及域名 如 :
20.205.243.166 github.com 
151.101.129.194 github.global.ssl.fastly.net

5、刷新DNS

#刷新 
sudo service network-manager restart

6、其它域名汇总

#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 
151.101.184.133 gist.githubusercontent.com 
151.101.184.133 cloud.githubusercontent.com 
151.101.184.133 camo.githubusercontent.com 
151.101.184.133 avatars0.githubusercontent.com 
199.232.68.133 avatars0.githubusercontent.com 
199.232.28.133 avatars1.githubusercontent.com 
151.101.184.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

参考文章:

1、网站dns查询

站长工具 - 站长之家

2、解决ubuntu无法正常访问github的问题(添加的域名比较全)

解决ubuntu无法正常访问github的问题_ubuntu无法访问github-CSDN博客

3、Ubuntu上Github下载慢的问题解决方法记录(linux自带工具查看网址的DNS)

Ubuntu上Github下载慢的问题解决方法记录-腾讯云开发者社区-腾讯云


http://www.kler.cn/a/415587.html

相关文章:

  • RiceChem——用于评估大语言模型在教育领域自动长答卷评分 (ALAG) 的数据集
  • Elasticsearch集群如何实现高可用和一致性
  • IP与“谷子”齐飞,阅文“乘势而上”?
  • 手机镜头组如此突出,考虑恢复以前设计
  • IDEA连接Apifox客户端
  • 【Docker项目实战】使用Docker部署Paint Board在线创意画板工具
  • Vue教程|搭建vue项目|Vue-CLI2.x 模板脚手架
  • 【机器学习】分类任务: 二分类与多分类
  • 现代网络架构PCI DSS合规范围确定和网络分割措施实施探讨
  • Flink四大基石之State
  • Python基础教程003:数据类型转换和标识符
  • 黑马程序员Java笔记整理(day05)
  • 为什么edge中选中文本会自动复制
  • 人工智能的微积分基础
  • 【拥抱AI】Milvus 如何处理 TB 级别的大规模向量数据?
  • Vue 前端 el-input 如何实现输入框内容始终添加在尾部%
  • 深入探索Facebook的技术生态:社交网络背后的科技创新
  • 【ruby on rails】dup、deep_dup、clone的区别
  • GitLab CVE-2024-8114 漏洞解决方案
  • 自由学习记录(26)