meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:docker:issues:8.8.8.8 [2026/07/06 13:20] – created niziaklinux:docker:issues:8.8.8.8 [2026/07/06 16:50] (current) niziak
Line 2: Line 2:
  
 Machine is configured to get DNS from dhcp. Machine is configured to get DNS from dhcp.
 +
 After host restart, there is no DHCP address and DNS set yet, but docker daemon starts and starts containers. After host restart, there is no DHCP address and DNS set yet, but docker daemon starts and starts containers.
  
-There is fallback mechanism "hardcoded" in [[https://github.com/moby/libnetwork|moby/libnetwork]]:  +If Docker cannot find a usable, non-local DNS server on your host, it defaults to 8.8.8.8 to ensure that containers have at least some connectivity, rather than failing completely: 
-[[https://github.com/moby/libnetwork/blob/3797618f9a38372e8107d8c06f6ae199e1133ae8/resolvconf/resolvconf.go#L58|resolvconf.go]]+  * [[https://github.com/moby/libnetwork|moby/libnetwork]]:  
 +  [[https://github.com/moby/libnetwork/blob/3797618f9a38372e8107d8c06f6ae199e1133ae8/resolvconf/resolvconf.go#L58|resolvconf.go]] 
 + 
 +===== workaround ===== 
  
 +<file ini /etc/systemd/system/docker.service.d/dns-override.conf>
 +[Service]
 +ExecStart=
 +ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --dns 192.168.1.50 --dns 1.1.1.1
 +</file>