Sniff the hostname rightly