“Local cannot update the hosts file and shows the error: ‘Could not update hosts file’, so my local WordPress site will not open.”

Subject: Local site not accessible – DNS / hosts issue on Windows

Hello,

I am experiencing an issue with Local on Windows.

The site is created successfully and shows as “Running” inside Local.
However, when I try to open the site in the browser, I receive one of the following errors:
• DNS_PROBE_FINISHED_NXDOMAIN
• ERR_CONNECTION_REFUSED
• Warning about missing hosts entry

The domain (e.g. mysite.local) does not resolve in the browser.

I have already tried:
• Running Local as Administrator
• Using the “Fix it” option for the hosts file
• Restarting the site
• Restarting the computer
• Checking firewall and antivirus permissions

Despite this, the issue persists.

It appears that Local is not properly writing to the hosts file or the local router is not functioning correctly.

Could you please advise how to properly resolve this DNS / hosts issue?

Hi @DVORAFDHBFZKY!

Have you tried changing your Router Mode? (Preferences>Advanced>Router Mode)

What about if you check in a different browser other than your default?

What version of Windows are you on?

Yes, I tried changing the router mode through Settings > Advanced > Router Mode, and I ran the process as administrator.

I also tested it on another browser, not just the default one, and the issue still occurs / (or: and it works fine on another browser — depending on what’s true for you).

I am using Windows version: [write your version here, e.g., Windows 10 / Windows 11].

In order to refresh here and start with a clean slate could you give the below troubleshooting steps a try?

Every time I exit a new crown, it takes a long time to download the network. However, when I exit it and enter it, it doesn’t seem to download. Deleting it also takes a long time, and it still shows me the same error.

Could you share some screenshots or a short video using Loom or something similar to show what you’re seeing from your end @DVORAFDHBFZKY? That might help us better understand what you’re experiencing.

Does your WordPress version every stop processing or does it keep loading continuously @DVORAFDHBFZKY? If it’s loading endlessly then it sounds like Local is either struggling to make a connection on the network or is being blocked by some security. Would you be able to test via a different network?