Moved hostname resolving to remote side.

To avoid being DNS spoofed.