What data is needed in hosts file?

What data do I write to the hosts file?

Local wants do this for me but cannot write to hosts file on my Windows machine. I tweaked file settings and anti-virus for 2 hours but still no joy. Interestingly, I can edit my hosts file with Notepad, so manually editing seems like the best path forward.

Note that I read numerous posts on this topic. None mentioned Xcitium Client Security. If someone is familiar with it, I am open to another attempt at tweaking anti-virus. Otherwise, learning what data to manually enter into my hosts file seems like my best option.

Hi @duke

What Windows version are you on?

Did you try this?

Hi Nick,

I am running Windows 10.

Thanks for the link. I have write access to etc/hosts. A/V is configured to ignore etc/hosts and allow all executables in the Programs(x86)/Programs folder. Despite this, Local cannot write to etc/hosts.

Are there processes outside the Programs(x86)/Programs folder that write to etc/hosts?

If not, since I am able edit etc/hosts using Notepad, what data do I need to write to etc/hosts for sites?

I’m not sure that would be a viable alternative. Have you tried contacting Xcitium Client Security or researching their documentation to look for any information regarding allowing or unblocking programs?

Hi Nick,

I contacted them but no resolution, yet.

Me writing to etc/hosts is viable. After all, that is what Local does. I just need to know the format and the type of data to enter. What is the format of your etc/hosts? What type of data is in it?

The reason we advise against this and regard it as not being viable is that anytime you spin up a site, change a domain, delete a site, use Local Connect actions, etc you’ll need to make Host File edits. This would make your local development quite cumbersome. It’s not as simple as making a single edit and then never having to touch it again. Local attempts to update the host’s files sporadically through many different actions within the app while you’re working. Are you at least able to temporarily disable XCS to see if that resolves the issue? It may be that something else is involved in blocking this.

Hi Nick,

XCS is required by policy. Disabling will involve updating Windows Server and editing GPO.

Troubleshooting shows that LocalWP employs temporary PowerShell scripts and batch files to write to etc/hosts. If there was a pattern to the script names, I could tell XCS to ignore that pattern. However, I see no pattern. The names appear to be randomly generated. Meanwhile, I found the pattern used by LocalWP to update etc/hosts. I can easily write a script to capture the data needed to update etc/hosts.

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