In git git pull, git init, git clone, error could not resolve host: github.com

Detailed error information:

fatal: unable to access 'https://github.com/*****.git/': Could not resolve host: github.com

The reason for the error: The domain name of github.com is not resolved by the host.

solution:

  1. Use the command: ping domain name address to resolve the IP address corresponding to the domain name.
    Enter $ ping github.com
    PING github.com (13.229.188.59) 56(84) bytes of data in the command line .
    12

As can be seen from the above figure, the domain name IP address of github obtained by parsing is: 13.229.188.59

  1. Add the domain name and IP address to the hosts configuration file of the computer host.
host配置文件的地址:C:\Windows\System32\drivers\etc

Then add 13.229.188.59 github.com to the hosts file, save and exit.

Guess you like

Origin blog.csdn.net/weixin_40599109/article/details/108445079