Trying to find a solution for ‘WordPress cURL Error 6: Could not resolve host’? Here’s how we fix it.
The cURL error 6 indicates that the cURL can’t resolve the hostname and it happens whenever there is a problem with the DNS server.
At Bobcares, we often receive requests to fix cURL errors as a part of our Server Management Services.
Today, let’s explore more on this error and see how our Support Engineers fix it.
What is cURL error 6?
cURL error 6 mainly occurs when the given remote host does not resolve properly. Also, it is related to the DNS, and we fix this error by resolving the DNS.
Now, let’s discuss the exact scenario of the error. Recently, one of our WordPress customers approached us with the below error message.
He confirmed that he started to receive this error after updating a plugin on the website.
How we fix the WordPress cURL Error 6: Could not resolve host?
On checking, our Support Engineers found that the error was occurring due to the WordPress plugin.We follow the below steps to fix the error.
1. First, we log in via SSH and edit /etc/resolv.conf.
vi /etc/resolv.conf
2. Next, we add Google public name servers and comment on the other nameservers.
nameserver 8.8.8.8
nameserver 8.8.4.4
#nameserver 1xx.1xx.1xx.x
#nameserver 1xx.1xx.1xx.x
3. Then after making the changes, we restart Apache or Nginx.
service apache2 restart
This fixes the error.
But sometimes the changes we made to /etc/resolv.conf file will be erased on reboot or restart. So we make some permanent changes in resolv.conf file.
sudo apt-get install resolvconf
Then we open the file to add the nameservers.
vi /etc/resolvconf/resolv.conf.d/base
After that, we add the nameservers on the file.
nameserver 8.8.8.8
nameserver 8.8.4.4
Finally, we save the file. By adding the Google name serves will fix the WordPress cURL Error 6.
[Need assistance in fixing cURL errors? – Our Experts are available 24/7.]
Conclusion
In short, the WordPress cURL Error 6: Could not resolve host error occurs during the WordPress plugin updates and it is related to DNS. Today, we saw how our Support Engineers fix this error.
This worked perfectly! Thank you very much for publishing this valuable information.
Tanks You for your information. Now i know what a problem in my website.
In GoDaddy we are having the shared plan. File is missing in cpanel. How to overcome this issue.
Hi,
Please contact our support team via live chat.
Hi there.
I’m having an issue which migrating from my server to Local (by Flywheel). I get the error:
Unexpected response: Error: cURL error 6: Could not resolve host: [MY LOCAL DOMAIN] (http_request_failed). You should check that the remote site is online, not firewalled, does not have security modules that may be blocking access, has UpdraftPlus version 2.10.3 or later active and that the keys have been entered correctly.
Obviously, my Local install IS online active and working correctly with it’s SSL. I’ve tried deactivating all my plugins on my Live site and starting a migration but the same curl error happens.
I’m on a MAC BigSur 11.4, Chrome Version 91.0.4472.164.
The plugin version is: 2.16.59.1
If it helps, my Live site is here: https://pythonslearning.com
Any ideas how I can fix this?
thanks – Mark
Hi,
Our Experts can help you with the issue, we’ll be happy to talk to you on chat.
I am facing a problem on my site https://sehatnagar.com/ which is something like:
Your site is unable to reach WordPress.org at api.wordpress.org, and returned the error: cURL error 6: Could not resolve host: api.wordpress.org
Hi shehryar,
Our experts can help you with the issue.we will be happy to talk to you through our live chat(click on the icon at right-bottom).
This working perfect thanks for sharing .
Glad to know that it worked for you.
I’m starting a wordpress site locally with a plagin Elementor, after updating Elementor to version 3.18.0 locally I have a cURL 6 error. To continue using Elementor I need to be connected to the internet. It’s very annoying, I went back to the previous version. Isn’t there a solution? Thank you
Hello,
Please contact our support team via live chat(click on the icon at right-bottom).
Thanks so much! It Works!
Hello,
Thank you for your feedback! We are delighted to hear that our article was helpful to you.