WordPress cURL Error 6: Could not resolve host – Solve it now
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.
2. Next, we add Google public name servers and comment on the other nameservers.
nameserver 126.96.36.199 nameserver 188.8.131.52 #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.
After that, we add the nameservers on the file.
nameserver 184.108.40.206 nameserver 220.127.116.11
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.]
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.