Mac system solves the problem that Github images cannot be loaded

1. The cause of the problem

The main reason is that the DNS system cannot resolve the domain name corresponding to the IP of this connection.

2. How to solve

first step

Right-click on the picture that cannot be loaded, and click Check. The html page will appear.
insert image description here
Copy the content of this src, copy the method, put the cursor on this src, a complete link will appear, copy this complete link.

second step

Go to the IPAddress.com website and look up the URL. The following picture appears.
insert image description here
The Domain in this picture is—github, so there is a problem with the resolution of the domain name github.com. This IP Address---- 140.82.112.3 should also be used

third step

Just go to the terminal, enter the sudo vi etc/hosts command, and enter your computer password to open this file. Enter i to enter the insert mode, scroll the mouse up and down, and let the cursor (gray rectangle) come to the end.
As shown in the figure below, the cursor should move from top to bottom.
insert image description here
insert image description here
Enter the value corresponding to the IP Address and the value corresponding to the Domain label +.com, press the esc key to exit, enter :wq!, save and exit. As shown below:
insert image description here

Refresh or restart github

3. Summary

It is worth noting that a .com should be added to the domain value, and input i to enter the insert mode, press esc to exit this mode, :wq! to save.

Guess you like

Origin blog.csdn.net/liuzr_/article/details/126780436