No route to DNS server from Docker container

Quick Fix

For anyone else having Fedora 31/32 Docker issues I suggest following the Fedora Magazine's Guide on Docker and Fedora 32

For me personally the issue was caused by the firewall blocking docker connections and the following command fixed it:

sudo firewall-cmd --permanent --zone=trusted --add-interface=docker0
sudo firewall-cmd --reload # reload the firewall rules

Moving to Podman

Docker requires a root daemon, which creates a security concern. The issue can be mitigated by switching over to Podman and using it with the same commands as Docker:

podman run --dns 8.8.8.8 busybox nslookup google.com