--network none (--net=none) emits logs of DNS-related operations

Open
#2,539 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
networking

Research direction

Start by tracing FilterResolvDNS through setupDNS and updateDNS, focusing on the --network none path and comparing it with the --network host bypass. Confirm the behavior using the log messages in the issue; done means launching a container with --network none no longer emits DNS-related operations logs.

Written by the indexing model from the issue text.

Description

Using Docker 18.09.7, when launching a container with docker run --network none ..., logs like these are generated:

dockerd[1768]: time="2020-03-17T14:00:52.808585281-07:00" level=info msg="No non-localhost DNS nameservers are left in resolv.conf. Using default external servers: [nameserver 8.8.8.8 nameserver 8.8.4.4]"
dockerd[1768]: time="2020-03-17T14:00:52.808612717-07:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers: [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]"

I dug through the Go code as best I could, but it seems to me that FilterResolvDNS is getting called by setupDNS nearly unconditionally (i.e. no check to see if networking is enabled or not), and updateDNS semi-conditionally (--network host seems to bypass this). I couldn't figure out what to add if-wise, nor where to add it, to essentially do nothing in the case --network none is used; I'm not familiar with the code to know what's needed.

This issue is indirectly touched on/referenced via #1063 and #1928 .

Use case justification: we have applications and infrastructure that launches Docker containers for single-command usage, so having thousands of these log messages when using containers launched with --network none (and containers which truly do no network I/O of any kind) seems very wasteful.

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

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.

More from moby/libnetwork

All issues in moby/libnetwork

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.