Docker DNS is not working (edit: fixed by stopping firewalld)

Hello there, I have been a Manjaro user on desktop and server for a couple years now and this is the first time I've needed to ask for help, so thank you for that :wink:

Currently, my docker containers don't have access to DNS services. For example:

~ >>> curl https://httpbin.org/user-agent                                                                                                                             
{
  "user-agent": "curl/7.67.0"
}
~ >>> docker run -it archlinux/base bash                                                                                                                           [1]
[root@9b8d1aa0da32 /]# curl https://httpbin.org/user-agent
curl: (6) Could not resolve host: httpbin.org
[root@9b8d1aa0da32 /]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 9.9.9.9
[root@c2c63431e25a /]# exit
exit
~ >>> cat /etc/resolv.conf                                                                                                                                            
# Generated by NetworkManager
nameserver 9.9.9.9

...why? How do I fix this? But more importantly, why?

I just thought to check and I am able to ping 9.9.9.9 from inside the container. However, predictably, nc -z 9.9.9.9 53 fails (that is, I can't reach the IP on port 53).

The problem seems to have cleared up by running

sudo systemctl stop firewalld
sudo systemctl restart docker

Does anyone have some advice on a more permanent fix?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by