The ping works, but the web page cannot be opened

If someone says that it is a "host" problem that prevents you from accessing the webpage, it may mean that there are certain configurations or modifications in your computer's hosts file that make it impossible to resolve the domain name of a specific website normally.

The Hosts file is a text file on the local computer that maps domain names to specific IP addresses. By editing the hosts file, you can manually specify the IP address corresponding to a domain name to achieve the purpose of modifying domain name resolution.

If there is a wrong configuration or malicious modification in the hosts file, it may cause you to be unable to access a specific website. You can try the following steps to troubleshoot hosts file issues:

  1. Check the hosts file: Open the hosts file, usually located in the following path of the operating system:

    • Windows:C:\Windows\System32\drivers\etc\hosts
    • macOS/Linux: /etc/hosts
      Make sure there are no unusual entries or mappings of domain names to IP addresses that you are unfamiliar with.
  2. Empty the hosts file: After backing up the original hosts file, try to empty the hosts file, then save and exit. This will restore the hosts file to its default state.

  3. Refresh the DNS cache: clearing the DNS cache can ensure that your computer can get the latest domain name resolution information again. You can run the following commands in Command Prompt (Windows) or Terminal (macOS/Linux):

    • Windows:ipconfig /flushdns
    • macOS/Linux:sudo dscacheutil -flushcache

My problem this time is: the IP address in the hosts file is wrong

Note that modifications to the hosts file require administrator privileges. If you are not sure how to do this or whether modifying the hosts file will adversely affect your computer, please seek professional help or advice.

Guess you like

Origin blog.csdn.net/l_010/article/details/131592195