Skip to content

[Request]: Support a flag to force tcp DNS #696

Description

@byjrack

Feature or enhancement request details

So been seeing where UDP DNS queries are not getting connected back to the bridge network for containers. If I do the same query via TCP using host, nslookup, dig, drill, whatever there are no issues. I am pretty positive it's the device network controls my organization have out there, but can't find the specific one yet. I can just see where a dns response via tcp the next "hop" is mdnsresponder but for udp the flow just ends.

I tried to update resolv.conf with options use-vc but it had no effect on the subsequent internal calls. I need to test more, but been doing most tests using musl based images and not glibc which i believe is the issue there.

$ host google.com
;; communications error to 192.168.64.1#53: connection refused
;; communications error to 192.168.64.1#53: connection refused
;; no servers could be reached
$ host -T google.com
google.com has address 142.251.179.102
google.com has address 142.251.179.100
google.com has address 142.251.179.113
google.com has address 142.251.179.138
google.com has address 142.251.179.139
google.com has address 142.251.179.101
google.com has IPv6 address 2607:f8b0:4004:c09::71
google.com has IPv6 address 2607:f8b0:4004:c09::64
google.com has IPv6 address 2607:f8b0:4004:c09::8b
google.com has IPv6 address 2607:f8b0:4004:c09::66
google.com mail is handled by 10 smtp.google.com.
google.com has HTTP service bindings 1 . alpn="h2,h3"

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added theissue type on Sep 30, 2025
  2. byjrack commented on Sep 30, 2025

    @byjrack
    Author

    And as some additional context no issues on Docker Desktop, Colima, or Rancher Desktop. All those have used vpnkit or some variant of that project to try and avoid network control tripping hazards.

    I did spot that --dns-option was available which seemed to correlate with adding a opts use-vc to resolv.conf. Still didn't fix things, but feels like maybe i can nudge dns to use TCP during init.

  3. jglogan commented on Oct 1, 2025

    @jglogan
    Contributor

    There is a bug in --dns-option down in the containerization layer that got fixed with apple/containerization#303.

    I created #697 to pick up this fix, so you can test with main and see if options use-vs works.

  4. byjrack commented on Oct 1, 2025

    @byjrack
    Author

    So gave the unsigned build a shot.

    It does fix the the opts to options, but tried a couple container images (musl and glibc) and all still used UDP for queries by default. Same experience i had when I added the option manually to resolv.conf. I had wondered if it was init based, but I think I figured out the cause.

    One of our controls binds 53/UDP/v4 on a specific interface. So apple/container can have mDNS grab 53 for TCP. Similar experience on #402 in the lsof output but for me its the control and not dnsmasq. I wonder if mdns could bind to the bridge gateway instead of all and still work, but don't know enough about the networking backend.

    Now I am still scratching my head why using use-vc for the resolver isn't working, but given dns is a bit low level i am guessing there is something subtle i am missing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions