Connect to the correct port when attempting to resolve a host name