Including Port numbers in %systemroot%\system32\drivers\etc\hosts File

mallows98 picture mallows98 · Nov 18, 2009 · Viewed 16.5k times · Source

Is it possible to include port numbers in hosts file? Reason that I'm asking is because I have sites that I'm trying to migrate from one hosting server to another, and the sites are pointing to an old SQL server that uses the standard TCP/IP port (1433). On the new server, the SQL Server port is different, and I don't want to change the connection strings for these sites.

Thank you!

Answer

Byron Whitlock picture Byron Whitlock · Nov 19, 2009

This is not possible in the host file. DNS doesn't know anything about port numbers.