Skip to content

fgwsz/my_hosts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

国内无法访问github的问题除了用某工具访问,还可以通过hosts文件来达到效果, 缺点就是需要经常更新ip地址。

一、查询ip地址

通过网址http://ip.tool.chinaz.com/来查询github.com的真实ip地址

二、修改hosts文件

host文件位置
Windows系统:C:\Windows\System32\drivers\etc
Linux系统:/etc/hosts
在hosts文件的最后添加如下信息:
${查询到的ip地址} ${目标网址}
Windows用管理员身份运行如下命令:

cp ./hosts "C:\Windows\System32\drivers\etc\hosts"

Linux运行如下命令:

sudo cp ./hosts /etc/hosts

三、更新dns缓存

Windows用管理员身份运行如下命令:

ipconfig /flushdns

Linux运行如下命令:

sudo systemctl restart NetworkManager

四、推荐的浏览器以及dns服务器

使用Edge浏览器
>>[...]
>>settings
>>搜索DNS
>>Use secure DNS to specify how to lookup the network address for websites[O]
>>Choose a service provider[O]
>>NextDNS[O]
>>Reboot Edge

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published