Host Remapping

Host Remapping

The Hosts file is an important mechanism for host name resolution, used to map a host name to an IP address. On Windows-based computers, this file is the Hosts file in the systemroot\System32\Drivers\Etc folder.

The advantage of using the Hosts file is that users can customize it for themselves and without affecting other people.

For more information on the Hosts file and Host Name Resolution on Windows-based computers, visit: http://technet.microsoft.com/en-us/library/bb727005(TechNet.10).aspx  
Hosts file editing might be disabled along with other permissions related to your system folders. For the remainder of this section, it is assumed that the user has the appropriate permissions.

Host re-mapping is a convenient approach in redirecting network communications to a QTAssistant System Proxy transparently, without modifying the configuration settings of the client application.

The Hosts file editing can be setup within QTAssistant by following these simple steps:

  • In QTAssistant's shell Automation Explorer window, add a new script file to an existing or new Script Set
  • Copy and paste the code below into the script file.
  • Alternatively, the file could also be referenced directly from QTAssistantHome\UtilityScripts\Shell folder. 
import System;

class Script {
 static function Main() {
  Session.Automation.LoadContent(new Uri(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers\\etc\\hosts")), "text/powershell");
 }
}

To edit the Hosts file right click on the EditHostFile.js file in the Automation Explorer tool window, and then "Run Script" using the "QTAssistant Shell" command.