以管理者身份运行文本编辑软件
从C:\Windows\System32\drivers\etc\hosts中打开hosts文件,并将要域名与ip地址对附加至文件未尾
例如(使得国内访问github更快):
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
打开命令行窗口,输入以下命令,使本地的 Hosts 文件生效:
ipconfig /displaydns //显示DNS缓存内容
ipconfig /flushdns //删除DNS缓存内容