🔧 Title: "Unable to Update Hosts File in Local – Tried Everything (Admin, Antivirus, Reinstall, Manual Edits)"

Hi everyone,

I’m facing a persistent and frustrating issue with Local by Flywheel (LocalWP) on Windows. I’m trying to run a local WordPress site, but I keep encountering the following error:

:red_exclamation_mark: Uh-oh! Could not update hosts file
Local ran into a problem when trying to update the hosts file.
Please ensure that the hosts file is not locked by anti-virus.

On the site overview in Local, I also get:

:warning: Warning! Missing hosts entry. This site may be inaccessible.


:magnifying_glass_tilted_left: Here’s What I’ve Tried So Far:

:white_check_mark: Antivirus Settings

  • I use McAfee Antivirus.
  • Real-time scanning has been turned OFF.
  • I have added the hosts file to the excluded list manually in McAfee.

:white_check_mark: Manually Edited Hosts File

  • Opened C:\Windows\System32\drivers\etc\hosts in Notepad (as administrator).
  • Tried adding:

lua

CopyEdit

127.0.0.1 toolstiphub.local
  • However, Windows tries to save it as hosts.txt, and editing doesn’t reflect in Local.

:white_check_mark: Confirmed Hosts File Content

  • My current hosts file contains this line (added manually):

lua

CopyEdit

127.0.0.1 toolstiphub.local
  • The file also includes Tailscale entries (I use Tailscale on this system).

:white_check_mark: Ran a .bat File as Admin

  • Created and executed a batch file to add the entry:

bat

CopyEdit

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set "hostfile=%SystemRoot%\System32\drivers\etc\hosts"
echo 127.0.0.1 toolstiphub.local >> "!hostfile!"
pause
  • It executed but did not solve the issue.

:white_check_mark: Checked with nslookup

  • When running:

lua

CopyEdit

nslookup toolstiphub.local

I get:

pgsql

CopyEdit

DNS request timed out.
*** Request to UnKnown timed-out

:white_check_mark: Completely Uninstalled Local

  • Uninstalled Local via Control Panel
  • Deleted the following folders:
    • %AppData%\Local
    • %AppData%\Roaming\Local
    • %LocalAppData%\Programs\Local
    • %UserProfile%\.local
  • Rebooted the system
  • Downloaded the latest version from https://localwp.com
  • Installed as administrator
  • Launched Local as administrator

Still, the issue persists.


:red_question_mark: What I Suspect:

  • The hosts file might still be locked by a background process or some Windows security feature.
  • Possibly a conflict with Tailscale DNS or network configs?
  • Windows Defender Controlled Folder Access was also disabled — no help.

:sos_button: What I Need:

Please let me know:

  1. Has anyone faced a similar issue with the hosts file being unmodifiable?
  2. Is there a permanent fix or workaround?
  3. Are there any hidden background processes or permissions that need to be reset?

Any help or advice from the community would be deeply appreciated! :folded_hands:

Thanks in advance!

I am waiting for the reply, so please reply to me ASAP so that I can proceed further with my task.

I have this same issue, along with the MySQL issue. I have done pretty much the same, with no results at all. In the meantime, I switched to develop on a Mac, which is not my main work environment and won’t work as a permanent solution.

After two weeks, I discovered a simple solution to my problem. I feel dumb for not thinking of this sooner. Just open IIS Manager, click on Default Website, and stop it. I hope this helps.

Can you please explain in detail how I can achieve this, as I am using it on Windows 11? Thank you.

Sure, hit the Windows key and look for Internet Information Services (IIS) Manager.


Expand the three options in the left column until you see a website, select it, then click Stop in the right column. After that, restart Local.

I hope this works for you. Good Luck!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.