I tried to modify the host file but it denied due to the installation cant access hosts file because being used for another process.

In my case the problem was a Firewall called TiniFirewall. To solve the problem right clic on the tiny firewall icon > Settings > Untick the "Prevent host file to being modified".

Now you can modifiy the host file witout problems.