Source: https://www.thomasmartens.eu/contabo-dns-lookup-timeouts/
I got a ton of getaddrinfo EAI_AGAIN
(alpine) and getaddrinfo ENOTFOUND
(debian) errors in my nodejs app, running in docker.
Also sometimes curl fails with curl: (6) Could not resolve host: ...
Turns out contabo DNS servers are unreliable.
-
Check default DNS servers:
resolvectl status | grep 'DNS Servers' -A2
orcat /etc/resolv.conf
-
Change DNS servers:
nano /etc/netplan/01-netcfg.yaml
. Comment out the problematic ones under network > ethernets > ens18 > nameservers > addresses and add working IPs instead such as the ones provided by Quad9 (9.9.9.9) or Google (8.8.8.8, 8.8.4.4). -
Apply changes:
sudo netplan apply
-
Test if everything works (run 1. again)