Q: Date/Time this occurred (Provide your time zone also)
A: Discovered this on 22 Nov 2022, 15:00, Sao Paulo, BR time.
Q: DevKinsta Version
Q: OS Version
A: MacOS Monterey, 12.6 (Running on M1 machine)
Q: Docker Desktop Version
Q: Were any error codes or messages observed? If so, what were they?
A: curl: (6) Could not resolve host: img.youtube.com
Q: Detailed Description of the Problem
A: We have a script that calls the url https://img.youtube.com to retrieve the thumbnail of specific youtube videos for the user. But we can’t make the request to that URL using PHP, or even curl in the bash.
I can replicate this on bash and PHP. Here is a snippet how to replicate it using curl in bash:
docker exec -it devkinsta_fpm bash
curl -L https://img.youtube.com/vi/1YyO12WGju0/0.jpg curl: (6) Could not resolve host: img.youtube.com
But if I call the domain that redirects to
www I get the same error:
curl -L https://youtube.com curl: (6) Could not resolve host: www.youtube.com
If I try another domain, like:
curl -L https://metaslider.com <it outputs the source code correctly>
curl -L https://www.metaslider.com <it outputs the source code correctly>
It seems to be related to DNS. The content of
/etc/resolv.conf is the following:
nameserver 127.0.0.11 options ndots:0
If I change to:
nameserver 18.104.22.168 options ndots:0
Those requests to youtube start working, but of course the local sites’ domains stop working.
I’m able to make requests to
img.youtube.com from another custom docker container, but not from inside the