Error messages from cURL

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

The error message occurs when the DNS servers configured in resolv.conf no longer respond correctly. To resolve the error, nameservers from different providers should be selected to increase reliability. In this example, we use the name servers from Cloudflare , Google and creoline.


Display the current nameservers

The current name servers can be displayed using cat /etc/resolv.conf.

cat /etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4


Only nameservers from Google Cloud are used here. If the Google name servers are not available due to a fault, DNS resolution will be disrupted.


The name servers can be changed using a text editor, e.g. 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, networking.service is reloaded.


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

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