Docker compose dns resolution failed

I have a container from which a dns request is being forwarded to host dns server during which I get following logs from docker.

    ping: Name or service not known

    [resolver] read from DNS server failed, dns: buffer size too small

The host is ubuntu running on wsl2. The container is a compose service.

Would like to know the possible causes of failing resolution. The name gets resolved through dig .

I couln’t reproduce it. How long is that domain and what kind of container you are trying from? Is this error happens using containers based on other images? For example, what happens with this image?

docker run --rm -it nicolaka/netshoot ping yourdomain

@rimelek I found that changing the dns server helped me get rid of the problem.