File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ RUN systemctl enable setup-resolvconf-nm.service
3535# NM by default leaves dummy* interfaces unmanaged. Explicitly mark dns-test0
3636# as managed so NM activates the connection profile below and drives DNS.
3737RUN mkdir -p /etc/NetworkManager/conf.d && \
38- printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=none \n' \
38+ printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=interface-name:eth0 \n' \
3939 > /etc/NetworkManager/conf.d/10-docker-dns-test.conf
4040
4141# type=dummy → NM creates the interface itself on activation.
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ COPY setup-resolvconf-nm.service /etc/systemd/system/setup-resolvconf-nm.service
2323RUN systemctl enable setup-resolvconf-nm.service
2424
2525RUN mkdir -p /etc/NetworkManager/conf.d && \
26- printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=none \n' \
26+ printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=interface-name:eth0 \n' \
2727 > /etc/NetworkManager/conf.d/10-docker-dns-test.conf
2828
2929RUN mkdir -p /etc/NetworkManager/system-connections
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ COPY setup-resolvconf.service /etc/systemd/system/setup-resolvconf.service
3030RUN systemctl enable setup-resolvconf.service
3131
3232RUN mkdir -p /etc/NetworkManager/conf.d && \
33- printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=none \n' \
33+ printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=interface-name:eth0 \n' \
3434 > /etc/NetworkManager/conf.d/10-docker-dns-test.conf
3535
3636# Real Ubuntu Desktop ships this config so NM delegates DNS to systemd-resolved
@@ -42,6 +42,11 @@ RUN printf '[main]\ndns=systemd-resolved\n' \
4242
4343RUN mkdir -p /etc/NetworkManager/system-connections
4444COPY dns-test0.nmconnection /etc/NetworkManager/system-connections/dns-test0.nmconnection
45+ # Ubuntu Desktop: resolved handles upstream DNS (via fallback.conf), not NM.
46+ # Remove dns= from the NM profile so NM doesn't push a ~. default route domain
47+ # to resolved — dns-test0 is a dummy interface that can't route to the internet,
48+ # so resolved would time out trying to reach 8.8.8.8 through it.
49+ RUN sed -i '/^dns=/d' /etc/NetworkManager/system-connections/dns-test0.nmconnection
4550RUN chmod 600 /etc/NetworkManager/system-connections/dns-test0.nmconnection && \
4651 chown root:root /etc/NetworkManager/system-connections/dns-test0.nmconnection
4752
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ COPY setup-resolvconf.service /etc/systemd/system/setup-resolvconf.service
3030RUN systemctl enable setup-resolvconf.service
3131
3232RUN mkdir -p /etc/NetworkManager/conf.d && \
33- printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=none \n' \
33+ printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=interface-name:eth0 \n' \
3434 > /etc/NetworkManager/conf.d/10-docker-dns-test.conf
3535
3636# Real Ubuntu Desktop ships this config so NM delegates DNS to systemd-resolved
@@ -42,6 +42,11 @@ RUN printf '[main]\ndns=systemd-resolved\n' \
4242
4343RUN mkdir -p /etc/NetworkManager/system-connections
4444COPY dns-test0.nmconnection /etc/NetworkManager/system-connections/dns-test0.nmconnection
45+ # Ubuntu Desktop: resolved handles upstream DNS (via fallback.conf), not NM.
46+ # Remove dns= from the NM profile so NM doesn't push a ~. default route domain
47+ # to resolved — dns-test0 is a dummy interface that can't route to the internet,
48+ # so resolved would time out trying to reach 8.8.8.8 through it.
49+ RUN sed -i '/^dns=/d' /etc/NetworkManager/system-connections/dns-test0.nmconnection
4550RUN chmod 600 /etc/NetworkManager/system-connections/dns-test0.nmconnection && \
4651 chown root:root /etc/NetworkManager/system-connections/dns-test0.nmconnection
4752
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ RUN systemctl enable setup-resolvconf.service
3737# NM by default leaves dummy* interfaces unmanaged. Explicitly mark dns-test0
3838# as managed so NM activates the connection profile below and drives DNS.
3939RUN mkdir -p /etc/NetworkManager/conf.d && \
40- printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=none \n' \
40+ printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=interface-name:eth0 \n' \
4141 > /etc/NetworkManager/conf.d/10-docker-dns-test.conf
4242
4343# Real Ubuntu Desktop ships this config so NM delegates DNS to systemd-resolved
@@ -52,6 +52,11 @@ RUN printf '[main]\ndns=systemd-resolved\n' \
5252# Profile must be mode 0600 or NM refuses to load it.
5353RUN mkdir -p /etc/NetworkManager/system-connections
5454COPY dns-test0.nmconnection /etc/NetworkManager/system-connections/dns-test0.nmconnection
55+ # Ubuntu Desktop: resolved handles upstream DNS (via fallback.conf), not NM.
56+ # Remove dns= from the NM profile so NM doesn't push a ~. default route domain
57+ # to resolved — dns-test0 is a dummy interface that can't route to the internet,
58+ # so resolved would time out trying to reach 8.8.8.8 through it.
59+ RUN sed -i '/^dns=/d' /etc/NetworkManager/system-connections/dns-test0.nmconnection
5560RUN chmod 600 /etc/NetworkManager/system-connections/dns-test0.nmconnection && \
5661 chown root:root /etc/NetworkManager/system-connections/dns-test0.nmconnection
5762
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ COPY setup-resolvconf-nm.service /etc/systemd/system/setup-resolvconf-nm.service
2323RUN systemctl enable setup-resolvconf-nm.service
2424
2525RUN mkdir -p /etc/NetworkManager/conf.d && \
26- printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=none \n' \
26+ printf '[main]\nplugins=keyfile\n[device]\nmatch-device=interface-name:dns-test0\nmanaged=true\n[keyfile]\nunmanaged-devices=interface-name:eth0 \n' \
2727 > /etc/NetworkManager/conf.d/10-docker-dns-test.conf
2828
2929RUN mkdir -p /etc/NetworkManager/system-connections
You can’t perform that action at this time.
0 commit comments