I'm runing a linux VM in virtualbox on my windows PC. I installed docker in the VM. Then I started an alpine container using docker run -it alpine
.
In this container, I can ping external IPs successfully. But when I tried to ping domain names, e.g. google.com, it always return ping: bad address 'google.com'
.
If I do nslookup google.com
, it will tell me can't resolve 'google.com'
. But all these operations can be done successfully in the VM (outside of the container).
In the /etc/resolv.conf of the container are the Google DNS server, 8.8.8.8
and 8.8.4.4
. While for the VM it's 127.0.1.1
.
Anyone know the similiar issue?