I need to addhosts temporarily and multiple times to Windows and would like to be able to do so without having to constantly edit the system32\drivers\etc\hosts file, since the changes only need to last the length of the session at most. I was hoping there is some sort of terminal command I could use (that works similar to net use) but for telling windows to map <hostname> to <ip>. Thanks
| |||
|
feedback
|
|
The MS KB article regarding the TCP/IP Host Name Resolution Order provides the following order:
It further states that:
And provides some links on how to change that order. Basically, as I see it, there are only 2 real parameters you control here:
My suggestion is that you manipulate the hosts file through a simple script (it is, after all, a simple text file, with a permanent and known location). Or, run a DNS service, configure it to be your primary one and serve the desired IP addresses from it. | |||
|
feedback
|
