How to configure user specific hosts file on Windows

imapollo picture imapollo · Apr 25, 2012 · Viewed 10.2k times · Source

There is Windows Server 2003 machine which has many users to access. Each of them want to configure their own hosts file to redirect a hostname to certain IP address. (They are virtual machines with same hostname and different IP addresses owned by each user.)

C:\WINDOWS\system32\drivers\etc\hosts

Also, we cannot simply ask users to use IP address to connect because the hostname is configured and need to be used in an application. Can we have this user specific hosts file configured or any workaround?

Answer

Amol picture Amol · Aug 25, 2014

technically this is not possible...a simple programmatic work around could be to write a script and at user logon replace the file with whatever values you want. since most of the changes in the hosts file are read at runtime, you should be able to achieve the result you are expecting