Regarding the problem that the locally configured domain name on Mac can be pinged, but the browser cannot access it (but other computers can access it)

1. How to configure domain name

1.1 sudo vim /etc/hosts

  • as follows:
    sudo vim /etc/hosts
    
    Insert image description here
    Insert image description here

1.2 Browser plug-in LiveHosts

  • As follows:
    Insert image description here
    Insert image description here
    I quite like this method, and there is no need to modify the hosts file, which is very convenient.

2. Problem description

  • After configuring the domain name, the domain name entered in the browser cannot be accessed, as follows
    Insert image description here

3. Problem solving methods

  • Ping the domain name is for the hosts file configured, please pay attention.

3.1 Try method 1—Make sure the agents are closed

  • If there is something like Clashx installed locally, you need to close it. If not, ignore this step.
    Insert image description here

3.2 Try method 2—Make sure the domain name can be pinged successfully

  • As follows
    Insert image description here
    Insert image description here
    Insert image description here
    : If there is no problem, please continue...

3.3 Try method 3—Clear browser cache

  • Enter in the browser:
    chrome://net-internals/#dns
    
  • Then clean up: click clear host cache
    If it still doesn’t solve the problem, see the following

3.4 Try method 4—Manually set DNS

  • Modify DNS
    Insert image description here

3.5 Ignore the network and reconnect

  • Delete the Wi-Fi you are currently connected to and then reconnect it. Try it. If it doesn’t work, read the following.

3.6 Try method 5—Clean files under SystemConfiguration

4. The effect of accessing the address bar if successfully solved

  • I used a plug-in here
    Insert image description here

Guess you like

Origin blog.csdn.net/suixinfeixiangfei/article/details/129179390