in reply to Bad hostname

Could iptables (or some other packet filter) be stopping you from connecting to that host? I think you can get a permission denied message in that case, but I'm not completely sure.