I'm having the same problem with Lunarpages. Ever since they move their servers from LA to San Diego a couple weeks ago, 2.7 can't download/.upgrade the plugings. They did lots of upgrades too (php, apache, etc.)
I am also using gmail lite, which is a php app/middleman where I can check my gmail account from. I use this because my work blocks gmail and other major webmail places (grr) But the glite also give me a similar "Can't connect" error.
Before they did the move and migration, wordpress 2.7 and glite worked fine. The plugins downloaded and installed, and I was able to view gmail email through glite.
So out of curiosity, I found a php script which will "wget" a file and copy it to the folder it's in. So I had it get one of the wordpress plugings. Well, it worked.
Here's the code: (just copy it to test.php and pop in in a test folder on your site. Then run the script... http://yoursite.com/test/test.php. It'll then download the plugin to that folder.
$foo = system('wget http://downloads.wordpress.org/plugin/tangofy.zip ~',$output);
So it appears like my web server can resolve the DNS since it got the file.
I'm kind of stuck... but I'm wondering if there is something that would affect this "connection problem" in any of these files.
.htaccess, php.ini (apache and php config files)
I looked through the settings and didn't see anything that caught my eye.
I do have wordpress 2.7 running on this computer I'm typing on now... and it works ok. So I don't think it's a bug in the wordpress software itself.