Apples "telnet" is broken
“telnet” is a program that lets you make an unencrypted login to another host on an arbitrary port. It is a useful testing tool, for making sure that the firewall you’re working on is working; or for making sure the service you are working on is answering. Normally you give it a hostname and a port number. Simple. Only, with apple, if you give it port 25 (“SMTP”), it decides not to do a regular host to IP lookup, but instead… does a MX record lookup. As in, it goes somewhere other than where you told it to go.
Jason-Feslers-computer:~ jfesler$ telnet gigo.com 22 Trying ”‘184.108.40.206”’… Connected to gigo.com. Escape character is ‘^]’. SSH-2.0-OpenSSH_4.5p1 FreeBSD-20061110 ^] telnet> close Connection closed. Jason-Feslers-computer:~ jfesler$ telnet gigo.com 25 Trying”’ 220.127.116.11”’… Connected to mx2.gigo.com. Escape character is ‘^]’. 220 goat.gigo.com ESMTP secondary mx only defers/rejects. email@example.com ^] telnet> close Connection closed. Jason-Feslers-computer:~ jfesler$ `
Update: This happens for ssh, nc as well. As it turns out, Apple’s doing this on quite a bit.. http://blog.jungledisk.com/2007/10/31/leopard-dns-issues-and-work-around/