Thanks for your input @joseph, I have found the issue!
It turns out that I am running cloudron in a qemu vm, and qemu has a bug in the default config where it will not resolve dns correctly if the first name server configured on the host fails.
In that case, it will not try the second nameserver configured on the host. DNS resolution will work on the host, but not on the guest.
Here is the link: https://unix.stackexchange.com/a/614603