Since Linux appears to only look at the first 3 entries of the resolv.conf, it's possible that the only dns resolvers that the default interface can reach will not be queried.
Example resolv.conf output, linux will only look at bolded configured nameservers.
root@cpe40:/# cat /etc/resolv.conf
nameserver <ip-address>
nameserver <ip-address>
nameserver <ip-address>
nameserver <ip-address>
nameserver <ip-address>
nameserver <ip-address>
Option 1:
Setting a static value in /etc/hosts using docker command:$ docker run --add-host=<FQDN>:<ip-address> --rm=true -ti debian:bookworm /bin/bash -i
Option 2:
Setting a static value in /etc/hosts using run-opt:run-opt 5 "--add-host=<FQDN>:<ip-address>"