Windows 7 hosts file per application

1

Is it possible to use the hosts file (C:\Windows\System32\drivers\etc\hosts) on a "per-application" level?

For example, I added this entry to the hosts file:

#Override NAS
192.168.1.3 NAS

Now NAS is resolved locally on my PC to 192.168.1.3 (default is 192.168.1.2 by DNS, for example), but I only want this setting for a specific application and all other application should be able to resolve NAS still to 192.168.1.3.

Any ideas?

Aldjinn

Posted 2013-10-23T05:25:35.780

Reputation: 11

Computer will ALWAYS look in hosts file first and if no matches there then it queries its configured DNS server – Ashtray – 2013-10-23T08:42:11.313

Answers

2

Hosts file always applies to the whole system. One thing you could do is make your hosts file like this:

#NAS
192.168.1.3 NAS

#Alternative NAS
192.168.1.2 NAS2

You'd use NAS2 as host instead of NAS, for apps you need to connect to different server. You can just add the NAS2 to your hosts, then NAS will be resolved with DNS.

#Alternative NAS
192.168.1.2 NAS2

Hope this helps

Jompper

Posted 2013-10-23T05:25:35.780

Reputation: 151