Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure user specific hosts file on Windows [closed]

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?

like image 632
imapollo Avatar asked Apr 25 '12 06:04

imapollo


People also ask

How do I modify my hosts file?

Right-click to Run as administrator. Once in Notepad, go to File -> Open. Get to C:\Windows\System32\Drivers\etc and make sure to select All Files to find the hosts file. Now you can edit the hosts file.

How do I lock a host file?

Lock Hosts file to prevent hijacking To prevent Host file hijacks, you may navigate to it, right-click on it, select Properties and make it a Read-only file. This will lock down your Hosts file and prevent anyone or any malware from writing to it.


1 Answers

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

like image 141
Amol Avatar answered Oct 17 '22 21:10

Amol