I've set up a redirect in the hosts file on my machine that basically points an auth domain to my local project in IIS (when run in Visual Studio for Mac) - however when I type the domain name into Chrome (for example), I get a message saying this site cannot be reached.
The local URL I want this to point to is: http://localhost:44380/ - the live URL I can't reveal for security but lets say for the sake of this example that it's: auth.site.com (the actual URL I'm using is valid and it does load in Chrome)
Here's my hosts file from terminal as it's currently set up:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 auth.site.com
I'm very familiar with windows and how the hosts file works, so from what I know there this would work in windows (I think anyways), is there something I'm missing here because obviously something isn't right?
I would first check where the problem is exactly. I think of the following possible issues:
ping auth.site.com
in a terminal. If you see responses from 127.0.0.1 this should work.curl auth.site.com:44380
in a terminal.If you are not happy with the given ports, you can do a port forwarding. Changing ports is not possible in the hosts file, because the hosts file is only for domain name lookup and this has nothing to do with the ports.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With