How To Fix WP HTTP Error Name Lookup Timed Out In WP Dashboard

Has your WordPress Dashboard suddenly slowed down, and the ‘WordPress Development Blog’ and ‘Other WordPress News’ widgets showing up ‘RSS Error: WP HTTP Error: name lookup timed out’? Well get ready for a debugging and fixing session if you see these symptoms, along with the Couldn’t resolve host ‘downloads.wordpress.org’ or the ‘An Unexpected HTTP Error occurred during the API request on WordPress Backend’ error.

In addition to above errors and warning messages, you may find that some plugins such as the Akismet comment spam plugin stop working, as they are unable to connect to their servers.

RSS_Error_WP_HTTP_Name_Lookup_Timed_Out

Step 1: Increase WP Connection Timeout

Whenever your WP dashboard sends a request, it waits for a defined interval that is set in the http.php file of wp-includes folder in your root directory. Here are the steps to increase this timeout interval, as given in a WordPress support topic:

Find and comment the below two lines from wp-includes/http.php file and save it.

[php]

curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $r['timeout'] ); curl_setopt( $handle, CURLOPT_TIMEOUT, $r['timeout'] );
[/php]

Create a php file (say HTTP_Timeout_Fix.php) and save the following piece of code in it. Zip the file and upload it to your plugins directory and activate the plugin.

[php]

<?php add_filter(‘http_request_args’, ‘tt_http_request_args’, 100, 1);

function tt_http_request_args($r) //called on line 237

{ $r['timeout'] = 15; return $r; } add_action(‘http_api_curl’, ‘tt_http_api_curl’, 100, 1);

function tt_http_api_curl($handle) //called on line 1315 { curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 15 ); curl_setopt( $handle, CURLOPT_TIMEOUT, 15 ); } ?>

[/php]

Now check to see if any of the issues you are facing such as the name lookup timed out error or the unable to find and install new plugins problems are solved. Not yet solved? Then the next possible reason could be wrong or unavailable DNS settings on your hosting server.

Step 2: Checking Server DNS Configuration

Download PUTTY or some other SSH terminal client. Log into your server and ping any website that you know for sure is up and running. For instance pinging yahoo.com on our Dreamhost server gave the error ‘unknown host’. This is a sure way to confirm that your web server is unable to resolve the IP addresses.

server-DNS-error

Contact your hosting server support team, tell them about the DNS resolution errors on your WordPress dashboard and the ping not working in SSH login. They should be able to solve this issue either by resetting the server DNS configuration or fixing it.

Looking for a good Web Hosting plan? Turning Track is hosted on DreamHost and we are glad to recommend this value for money hosting service to you. Sign up for DreamHost , get unlimited disk space, bandwidth, and also a great support.

Delicious

Related posts:

1 Comment

  1. Ann says:

    Thanks for this article. Hate to ask a stupid question … when you say find “and comment” what exactly do you mean by “comment”. Not newbie at Internet Marketing … just lack confidence in fooling around with code in files.
    Thanks … have been seeking a solution to this session timed out issue for 3 weeks via hosting company and have tried everything else…cheers

Leave a Reply