I was encountering DNS issues with Docker containers orchestrated by DDEV earlier. Some hosts failed to resolve only within the container for some reason.
To fix it, I changed the following options in the `/etc/default/docker` file:
DOCKER_OPTS="--dns 188.8.131.52 --dns 184.108.40.206"
This helps override the DNS options for Docker containers. Afterwards restart the Docker service:
sudo service docker restart
This solved the problem for me. I found the solution on Stackoverflow.