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 22.214.171.124 --dns 126.96.36.199"
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.