Is there anyway to make a browser ignore the hosts file?

3

I am currently working on a dev site and we edit hosts file since we do not want to make any changes to the live site however I need to copy some of the content from the original site to the dev site so I would like to switch between dev and live site without editing the hosts file every time

JeVic

Posted 2017-11-02T11:12:33.887

Reputation: 131

2

Use Opera browser which has built-in VPN support. Enabling VPN will bypass HOSTS. Opera Browser with Free VPN Built-in

– w32sh – 2017-11-02T12:16:37.423

Answers

4

No.

The browser doesn't read the HOSTS file directly. The browser makes a DNS request to the OS and the OS returns a response (having checked the HOSTS file). So, it's the OS's DNS resolver you would need to override and I'm not aware of an easy override for that.

If manually editing the HOSTS file is too much work, then maybe some kind of script to automate this would be useful? However, you could still run into problems with the browser/OS caching the DNS, so flushing the DNS cache would need to be made part of this script.

DocRoot

Posted 2017-11-02T11:12:33.887

Reputation: 151