Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong resolv.conf used on Ubuntu 19 (systemd-resolved enabled) #39978

Closed
NickStemerdink opened this issue Sep 24, 2019 · 1 comment
Closed

Wrong resolv.conf used on Ubuntu 19 (systemd-resolved enabled) #39978

NickStemerdink opened this issue Sep 24, 2019 · 1 comment

Comments

@NickStemerdink
Copy link

Description
I'm running Ubuntu 19.04 which has systemd-resolved enabled by default in mode one. The systemd-resolved manual states that traditional linux programs should use /etc/resolv.conf. Currently because of commit e353e7e however it will use /run/systemd/resolve/resolv.conf when systemd-resolved is running.

/ETC/RESOLV.CONF
Four modes of handling /etc/resolv.conf (see resolv.conf(5)) are supported:

   •   systemd-resolved maintains the /run/systemd/resolve/stub-resolv.conf file for
       compatibility with traditional Linux programs. This file may be symlinked from
       /etc/resolv.conf. This file lists the 127.0.0.53 DNS stub (see above) as the only
       DNS server. It also contains a list of search domains that are in use by
       systemd-resolved. The list of search domains is always kept up-to-date. Note that
       /run/systemd/resolve/stub-resolv.conf should not be used directly by applications,
       but only through a symlink from /etc/resolv.conf. This file may be symlinked from
       /etc/resolv.conf in order to connect all local clients that bypass local DNS APIs
       to systemd-resolved with correct search domains settings. This mode of operation is
       recommended.

   •   A static file /usr/lib/systemd/resolv.conf is provided that lists the 127.0.0.53
       DNS stub (see above) as only DNS server. This file may be symlinked from
       /etc/resolv.conf in order to connect all local clients that bypass local DNS APIs
       to systemd-resolved. This file does not contain any search domains.

   •   systemd-resolved maintains the /run/systemd/resolve/resolv.conf file for
       compatibility with traditional Linux programs. This file may be symlinked from
       /etc/resolv.conf and is always kept up-to-date, containing information about all
       known DNS servers. Note the file format's limitations: it does not know a concept
       of per-interface DNS servers and hence only contains system-wide DNS server
       definitions. Note that /run/systemd/resolve/resolv.conf should not be used directly
       by applications, but only through a symlink from /etc/resolv.conf. If this mode of
       operation is used local clients that bypass any local DNS API will also bypass
       systemd-resolved and will talk directly to the known DNS servers.

   •   Alternatively, /etc/resolv.conf may be managed by other packages, in which case
       systemd-resolved will read it for DNS configuration data. In this mode of operation
       systemd-resolved is consumer rather than provider of this configuration file.

   Note that the selected mode of operation for this file is detected fully automatically,
   depending on whether /etc/resolv.conf is a symlink to /run/systemd/resolve/resolv.conf
   or lists 127.0.0.53 as DNS server.

Describe the results you received:
/run/systemd/resolve/stub-resolv.conf is used.

Describe the results you expected:
I would expect that /etc/resolv.conf is used.

Output of docker version:

Docker version 19.03.2, build 6a30dfca03

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 19
  Running: 0
  Paused: 0
  Stopped: 19
 Images: 75
 Server Version: 19.03.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.0.0-29-generic
 Operating System: Ubuntu 19.04
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.56GiB
 Name: nick-desktop
 ID: 7QKQ:QK7I:U7A5:YLHI:BO2G:KTQV:QHSN:I5HT:HRQR:CKXN:BAL3:OFZM
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
@thaJeztah
Copy link
Member

Thanks for reporting; this is indeed something that needs a solution (but there's some complications); there is an existing issue about that #38243 (also see the discussion on moby/libnetwork#2385 (comment))

let me close this one as duplicate of #38243 to prevent the discussion from diverging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants