Categories
Cloud

Contabo: DNS Lookup Timeouts

This blog (and a bunch of internal services) are running on a Ubuntu 20.04 VPS hosted by Contabo, a German low-cost webhoster. General availability is fairly good so far and the amount of available memory is generous compared to (for example) Hetzner or OVHcloud.

As you might expect, the low price point does come with a few drawbacks. Most of these drawbacks (like automated backups taken by the provider) are fine with me given the price.

One problem I did however run into very frequently and which caused a lot of trouble were failed DNS lookups.

In Node.js applications you might see errors such as getaddrinfo EAI_AGAIN baserow.io, using the nslookup baserow.io command on your shell you’d get an ;; connection timed out; no servers could be reached error.

This was particularly annoying in my RSS reader (which fetches new posts in the background, meaning I wouldn’t immediately notice problems).

Running systemd-resolve --status | grep 'DNS Servers' -A2 reveals the revolvers in use:

Contabo default DNS servers 213.136.95.11 and 213.136.95.10

The same DNS lookups seem to be working fine when manually specifying a DNS server such as Quad9 (9.9.9.9):

Quad9 resolving my domains just fine

So in order to solve the problem, I simply needed to replace the default Contabo DNS servers in the /etc/netplan/01-netcfg.yaml file pre-filled by Contabo. Simply comment out the problematic ones under network > ethernets > ens18 > nameservers > addresses and add working IPs instead such as the ones provided by Quad9 or Google.

After editing the file, the sudo netplan apply applies the changes and another round of systemd-resolve --status | grep 'DNS Servers' -A2 should return the working DNS servers:

Working Contabo DNS configuration