I have the same issue here. On a server which indeed has an internet connection. I have no clue why cpan cannot connect. LWP::Agent is installed. wget, elinks, ssh can all connect to remote servers. There is no proxy, just a direct connection to the internet.