moby / moby/libnetwork

Proposal: Need options to disable embedded DNS

Open
#1,085 19 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.2k
Forks
875
PR merge metrics
No merged PRs in 30d

Description

I want to use default bridge and macvlan network in k8s. However, when container connect to macvlan network, DNS of default bridge network will be changed by macvlan network:

Start container with default bridge network:

[root@kube-node1 ~]# docker ps
CONTAINER ID        IMAGE                                COMMAND               CREATED             STATUS              PORTS               NAMES
e9bed187828f        sshd:1.0                             "/usr/sbin/sshd -D"   11 minutes ago      Up 11 minutes                           k8s_sshd-1.aea60a3a_sshd-1_default_33a61753-fc72-11e5-9520-525460110101_85c3614c
127973c47c43        gcr.io/google_containers/pause:2.0   "/pause"              11 minutes ago      Up 11 minutes                           k8s_POD.6059dfa2_sshd-1_default_33a61753-fc72-11e5-9520-525460110101_94dbf418

[root@kube-node1 ~]# docker exec e9bed187828f cat /etc/resolv.conf 
search default.svc.cluster.local svc.cluster.local cluster.local default.svc.cluster.local svc.cluster.local cluster.local
nameserver 10.254.0.10
options ndots:5
options ndots:5
[root@kube-node1 ~]# docker exec e9bed187828f nslookup kubernetes.default
Server:         10.254.0.10
Address:        10.254.0.10#53

Name:   kubernetes.default.svc.cluster.local
Address: 10.254.0.1

Connect container to macvlan network:

[root@kube-node1 ~]# docker network create -d macvlan --subnet=10.10.10.0/24 --gateway=10.10.10.1 -o parent=eth0 pub_net
056f952e74668afcce1f9f2d9543e847f562da0d044862775b0e660c85b9f744

[root@kube-node1 ~]# docker network connect --ip="10.10.10.100" pub_net 127973c47c43

/etc/resolv.conf will be changed:

[root@kube-node1 ~]# docker exec e9bed187828f cat /etc/resolv.conf 
search default.svc.cluster.local svc.cluster.local cluster.local default.svc.cluster.local svc.cluster.local cluster.local
nameserver 127.0.0.11
options ndots:5 ndots:0
[root@kube-node1 ~]# docker exec e9bed187828f nslookup kubernetes.default                                               
;; connection timed out; trying next origin
Server:         127.0.0.11
Address:        127.0.0.11#53

Name:   kubernetes.default.svc.cluster.local
Address: 10.254.0.1

This will make every DNS query to 127.0.0.11 at first, and connection timeout, then to 10.254.0.10. Make DNS query to be slowly.

;; connection timed out; trying next origin

@mrjana @mavenugo @thockin @brendandburns

Refer to #19474

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the default bridge and macvlan setup with the documented docker network create and network connect commands, then inspect libnetwork's embedded DNS behavior during network attachment. Define the disabling option and its expected resolver behavior before adding coverage for the reported lookup timeout; the issue names no source file or test entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go, kubernetes
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.