How and Why to do a Hosts file modification
Learn how to redirect domain traffic from your browser to a specific IP address regardless of external DNS. This can be useful when wanting to test the migration of a server deployment to a new IP address before pushing live DNS / visitor traffic to the new server IP address.
A specific troubleshooting use case example would be to apply Hosts file modification as troubleshooting step with Server UI / Gallery issues where architecture includes the use of load balancers, proxies, or application gateways where the FQDN does not direct to the Gallery node. The Hosts file modification could be used to bypass these and direct the hostname directly to the Gallery nod IP address. This could be performed directly on the Gallery Server node itself, via RDP, applying the Hosts file modification locally using the loopback address (Hosts file modification example: 127.0.0.1 prod.alteryx.com)
Prerequisites
- A common text editor ( we recommend Notepad++ )
Or
- Administrator privileges frorm the Windows Command prompt
Procedure
- Identify the IP address of the server you wish to redirect domain traffic to (this should be done form the machine where the test server is located)
ipconfig
- On your laptop, update the hosts file, by appending both the IP address and the domain name (eg. FQDN or hostname) that you wish to direct all traffic to.
Spoilers
**In Windows a new hosts file modification can quickly
added from the Windows Command prompt (this example inserts IP address '127.0.0.1' with FQDN 'prod.alteryx.com' into the Hosts file)
echo 127.0.0.1 prod.alteryx.com >>C:\Windows\System32\drivers\etc\hosts
**
image.png
image.png
Additional Resources