I have a home web server and I cant access website from the external ip when inside my local network (due NAT loopback). Im trying to be able to seamlessly access my sites from outside and inside my local network so editing the hosts file is not going to work as far as I know. I cannot configure the NAT loopback settings on my router (supplied by xfinity).
Using the HOSTS file is not going to be a permanent solution if you need access both internally and externally. You may want to look into something like Dynamic DNS as a more permanent solution.