Error when I trys to set up a DNS for docker

Hello guys,

So I have a problem with DNS on the docker. I have to put it to work on a machine with CentOS 8 and with private IPs and DNS since it is for internal use, a Gitlab container and its respective runner.

The Gitlab container is working fine, but I can’t get the runner to run the jobs as he should. I already checked the gitlab-ci.yml file and there is no problem. When I put the job to run, it gives this error message, and he can’t download the dependencies to run the job, because the container that the runner creates, can’t resolve the DNS.

So I tried to set a DNS for all containers using daemon.json, but it went back to an old problem that was when jobs got stuck. I tried to make this definition through the command dockerd --dns "server ip" and it presents this error

I honestly do not know what to do because my experience with such matters and handling CentOS is low, since this is the first job I have to deal with such areas. Thanks in advance to anyone who can help me solve this problem

In terms of connectivity it’s all fine. I can ping from one container to another with no problem.