Problems connecting to sites on the same server – Couldn't connect to host

I have a multisite setup and have just upgraded to WordPress 3.6. I saw a notice at the top of the admin page that says I needed to do a network upgrade. I went to the page, clicked the “Upgrade Network” button and I receive the following error message:

Your server may not be able to connect to sites running on it. Error message: couldn’t connect to host.

I am also having issues with the YOURLS plugin (http://wordpress.org/plugins/yourls-wordpress-to-twitter/) when it tries to locate the config.php file locally on the same webserver. When I try to locate it directly using a URL it also fails.

These 2 issues seem to point to some kind of issue connecting to sites on the same server, but I have no idea where to start looking for a solution.

If you need any more information then please let me know.

Many thanks,

James