Skip to content

Built-in DNS server extremely slow for large responses #4430

@dziemba

Description

@dziemba
  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: 747C7FF1-4351-4543-B9E8-2B79CD4183A2/20200407164330

Expected behavior

When running DNS queries through docker's built-in DNS server, I expect similar performance (response times) compared to using external DNS servers directly.

Context

While the following reproduction case is an artificial example, it is a quite common case to have these huge DNS responses, especially when working with K8s ingress etc. I'm filing this issue because we essentially can't use Docker for Mac at our company because it breaks our DNS resolution (by timing out a lot).

Using an external DNS server directly is not an option for us since we also need DNS resolution for hostnames in the current docker network (for integration tests etc.)

Actual behavior

When executing DNS queries that yield large responses, it takes an extremely long time to return results. The results look correct though. This only happens on Docker for Mac. Running the same queries on linux-native docker does not show the same issue.

Information

  • macOS Version: 10.15.4
  • Docker Desktop Version: 2.2.0.5

Steps to reproduce the behavior

  1. To reproduce create a docker container with dig installed:
docker run -ti debian bash
apt-get update && apt-get install -y dnsutils
  1. Then run DNS queries that yield large responses in that container:
time dig hugedns.test.dziemba.net  # ~5s
time dig hugedns.test.dziemba.net @ns-73-a.gandi.net  # ~0.2s
  1. If you run queries that involve a lot of CNAMES, the performance gets even worse:
time dig cname5.hugedns.test.dziemba.net  # ~18s
time dig cname5.hugedns.test.dziemba.net @ns-73-a.gandi.net  # ~0.2s

As you can see, this only happens when docker's DNS server is used. When querying the external DNS server directly, performance is not impacted. When run on linux directly (not Docker for Mac), docker's built-in DNS server is also as fast as the external one.

Please let me know if you need more details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions