Unable resolve server name in one container, but works in another container

Hi, docker community,

I have 2 docker containers (A and B) running on a same server.

They use the same image , but runs in 2 different subnet. A runs in 10.1.42.0/24, B runs in 10.1.43.0/24.

Since A and B uses the same image, the settings within the containers are the same.

But A can resolve a server name to ip address correctly, but B can’t.

For example, running “ping www.google.com” inside both containers:

A:
translate to ip : 172.217.12.196 immediately.

B:
hangs , and then report “Name or service not known”.

Both A and B has the same /etc/resolve.conf file, and both can ping “127.0.0.11”.

Does anyone have any suggestion to investigate further?

thanks.
Michael