Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress wp_remote_post() gives "cURL error 6: Could not resolve host"

Since this morning some function in a wordpress site I'm managing is not working anymore. I syslogged the response from it, which gives me:

{"errors":{"http_request_failed":["cURL error 6: Could not resolve host: subdomain.example.com"]},"error_data":[]}

When I manually run curl from that machine I simply get the html as a response. Since it says it could not resolve the host, I presume the problem occurs before the domain name can be resolved to an ip. So I guess (but not sure) this has something to do with the DNS.

I really don't understand what could be wrong here or how I can debug this. Does anybody have a suggestion?

All tips are welcome!

like image 987
kramer65 Avatar asked Oct 28 '25 10:10

kramer65


1 Answers

as mentioned here and due to this USN:

you will may need to update your dist

sudo apt-get update
sudo apt-get dist-upgrade

this fixed my issue with curl


Update

you will need to be aware of the dist-upgrade step, some packages -such as php- during the updrage will prompt you to ask you wether you want to replace the configuration files , you must be very aware of what you are doing here , keeping those files or replacing with the new -default- files.

like image 145
hassan Avatar answered Oct 30 '25 01:10

hassan