github image cannot be displayed
Problem: DNS cannot resolve the ip address of the external image
Solution: Change the DSN server + modify the host file for parsing the ip
1. Change the DNS server of Alibaba Cloud
-
Set DNS server address
Setting the properties of network connections in the control panel
![在这里插入图片描述](https://img-blog.csdnimg.cn/6cb65d1f379d4395ac057fa5e4e5deaa.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTU0OTM3MA==,size_16,color_FFFFFF,t_70#pic_center)
The ip addresses of Alibaba Cloud's public DNS servers are: 223.5.5.5 and 223.6.6.6, and fill in the preferred and optional in turn
-
Modify the hosts file
- Get image domain name
Press Ctrl + Shift + i on the opened github page, the developer tool window will pop up, click the small arrow on the right, and select the picture that cannot be displayed. You can
see that the full domain name of the picture resource israw.githubusercontent.com
-
Query the ip of the address mapping
Check the ip mapped by raw.githubusercontent.com on the domain name resolution website https://www.ipaddress.com/
(as of 2021.8.4, the ip may change, please refer to the latest query information)
It can be found that the domain name is mapped to 4 ips, just pick the top ip and write it into the host fileWrite the domain name resolved to the same ip into the host file together (the reason is to be investigated)
-
Modify the hosts file
In the win10 system, the hosts file is in
C:\Windows\System32\drivers\etc\hosts
-
Develop a good habit, make a copy of important files first: host_backup
-
Then modify the hosts file attribute so that ordinary users can modify the file
- -
Add domain name resolution content at the end of the hosts file
-
Refresh the original page to see if the image is parsed successfully
- Change the modification permissions of the hosts file back
-
The method is personally tested, I hope it will be helpful to everyone~