Error Messages from cURL

curl: (6) Could not resolve host: api.paypal.com

This error message occurs when the DNS servers configured in resolv.conf are no longer responding correctly. To resolve the issue, you should choose name servers from different providers to increase reliability. In this example, we use the nameservers from Cloudflare , Google, and creoline.


Viewing the Current Nameservers

You can view the current nameservers by running cat /etc/resolv.conf.

cat /etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4


Only Google Cloud nameservers are used here. If Google’s nameservers are unavailable due to an outage, DNS resolution will be disrupted.


The nameservers can be changed using a text editor, such as nano.

# nano /etc/resolv.conf

nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 5.1.73.73


After modifying resolv.conf, the changes must be applied. To do this, reload the networking.service.


root@creoline:~# /etc/init.d/networking reload

[ ok ] Reloading network interfaces configuration...done.