Solve the problem that github pictures cannot be displayed

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)

insert image description here
insert image description here
insert image description here

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

  1. 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
    insert image description here
    see that the full domain name of the picture resource is

    raw.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)

    insert image description here
    It can be found that the domain name is mapped to 4 ips, just pick the top ip and write it into the host file

    Write the domain name resolved to the same ip into the host file together (the reason is to be investigated)

insert image description here

  • 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
      -insert image description here

    • Add domain name resolution content at the end of the hosts file
      insert image description here

    • Refresh the original page to see if the image is parsed successfully

    insert image description here

    • Change the modification permissions of the hosts file back

The method is personally tested, I hope it will be helpful to everyone~

Guess you like

Origin blog.csdn.net/weixin_45549370/article/details/119383624