How do I change the resolv.conf file?

Hello,
I also tried other methods but did not get any results:

# /etc/docker/daemon.json
{
    "dns": ["4.2.2.4", "8.8.8.8"]
}

And:

# dockerd --dns 8.8.8.8

Does Docker use the host’s DNS settings by default?