完美解决
解决办法
- 首先要想解决这个问题,可以使用修改hosts文件,它的目录在
C:\Windows\System32\drivers\etc
找到host文件- 双击右键—>属性
- 点击安全—>高级
- 左下角 ->添加
- 选择主体
- 左下角—>高级
- 立即查找
- 点击确定
- 勾选框框为可修改点击确定
- 看到已经成功添加–>点击确定
这里会提示降低计算机安全性,点确定就行,用户是自己,安全性自己掌控
- 用管理员身份打开记事本
- 选择文件—>打开
- 找到hosts文件,注意必须是原始文件,之前配置过git-hub的把那段删了,只需要在下面加两行代码即可
192.30.255.112 github.com git
185.31.16.184 github.global.ssl.fastly.net
- 点击保存,Ctrl+s
Win+R 输入cmd打开黑框框
输入
ipconfig /flushdns
看到
然后输入:
ping github.com
看到
配置完成
在这提供原始的 hosts文件里面的内容
# 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 localhost
只需要在最下面加入上面的两行代码即可。
大功告成了,如果能够帮助到你,还希望能给小舞点个支持哦~~