You are not logged in.
I have 2 arch linux computers, docker is installed on both. However, on the second one I have the problem that the running container can not connect to the internet. At least not via domain names, but pinging IPs directly works.
Computer 1
docker run alpine ping www.google. com
=> works fine
Computer 2
docker run alpine ping www.google. com
=> ping: bad address 'www.google.com'
When I pass the --dns parameter it works fine too for PC 2
docker run --dns=8.8.8.8 alpine ping www.google. com
Both are using a wired connection to a Fritz Box configured in
/etc/systemd/network/wired.network
Computer 1
[Match]
Name=enp0s25
[Network]
Address=192.168.178.3/24
Gateway=192.168.178.1
DNS=192.168.178.1
#DHCP=yes
IPForward=yes
[Link]
WakeOnLan=magic
Computer 2
[Match]
Name=enp1s0
[Network]
Address=192.168.178.2/24
Gateway=192.168.178.1
DNS=192.168.178.1
#DHCP=yes
IPForward=yes
[Link]
WakeOnLan=magic
Pinging www.google.com from machines direktly works fine on both.
Does anyone have a idea, why I have to use the DNS flag on computer 2?
Offline
Offline
Thanks that was the reason, Computer 2 had a bad IP configured in etc/resolv.conf.
I now installed openresolv, generated a new config using resolvconf -u and edited my router's IP.
#
# /etc/resolv.conf
#
#search <yourdomain.tld>
nameserver 192.168.178.1
# End of file
Now everything works fine.
Offline
Offline