Bobcares

WordPress cURL Error 6: Could not resolve host – Solve it now

by | Feb 5, 2020

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.

cURL error 6: Couldn't resolve host

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.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

14 Comments

  1. Johannes Jooste

    This worked perfectly! Thank you very much for publishing this valuable information.

    Reply
  2. Raja safety

    Tanks You for your information. Now i know what a problem in my website.

    Reply
    • Brindha

      In GoDaddy we are having the shared plan. File is missing in cpanel. How to overcome this issue.

      Reply
      • Hiba Razak

        Hi,
        Please contact our support team via live chat.

        Reply
  3. sachin

    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

    Reply
    • Hiba Razak

      Hi,

      Our Experts can help you with the issue, we’ll be happy to talk to you on chat.

      Reply
      • shehryar

        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

        Reply
        • Hiba Razak

          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).

          Reply
  4. sachin

    This working perfect thanks for sharing .

    Reply
    • Hiba Razak

      Glad to know that it worked for you.

      Reply
  5. antonio

    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

    Reply
    • Hiba Razak

      Hello,
      Please contact our support team via live chat(click on the icon at right-bottom).

      Reply
  6. Bob Lau

    Thanks so much! It Works!

    Reply
    • Krishna Priya

      Hello,
      Thank you for your feedback! We are delighted to hear that our article was helpful to you.

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF