Skip to content

macOS: DNS forwarder intermittently SERVFAILs every upstream after boot; queries never reach the wire (macsys, 1.98.8 stable & 1.101.162 unstable, macOS 26.5.2) #20417

Open

Description

@dszp

Environment

  • macOS 26.5.2 (25F84) throughout — same build across all broken and working periods below
  • MacBook Pro (M2), Tailscale standalone/macsys variant
  • Observed on 1.98.8 (stable) and 1.101.162 (unstable), including on completely fresh installs (app + system extension fully removed and reinstalled between tests)
  • Bug report markers captured while broken:
    • BUG-a8cdef85481b7f3e305c401e00f7eaea6d6b923bb1b6fc6ef1ac19e16b198f24-20260707043933Z-0a868dbd7632230e (2026-07-07, during the first broken period)
    • BUG-a8cdef85481b7f3e305c401e00f7eaea6d6b923bb1b6fc6ef1ac19e16b198f24-20260713033123Z-96b874b380890e29 (2026-07-13, current broken state, 1.98.8)

Symptom

The embedded DNS server at 100.100.100.100 answers MagicDNS names for my own tailnet normally, but every query requiring the forwarder returns SERVFAIL. With "Use Tailscale DNS" enabled (whole OS pointed at quad-100) it degrades to total timeouts under system query load, taking down OS-wide DNS. Independent of upstream type — all of these fail identically:

  • No resolvers configured (forwarding to system default: LAN router via link-local IPv6, ISP IPv6 resolvers, 1.1.1.1 — plain UDP 53)
  • NextDNS DoH global nameserver (via the NextDNS integration)
  • Cloudflare global nameservers

tailscale dns query example.com A → RCodeServerFailure, no answers.

Intermittency — this appears to be a per-boot condition

  • 2026-07-05 → 07-08: broken. Persisted across multiple reboots and across full uninstall/reinstall of two client versions during this window.
  • 2026-07-09 → 07-12: working, after one particular reboot (which followed a full app + system-extension removal and fresh 1.98.8 install — but note the same removal/reinstall had NOT helped during the broken window). Verified end-to-end on 07-12: quad-100 forwarded external names, NextDNS DoH dialed and served (test.nextdns.io: status ok), including with an exit node active.
  • 2026-07-13: broken again immediately after the next reboot. No client, OS, or configuration change of any kind in between — the same 1.98.8 install that was working hours earlier.

While broken: quitting and relaunching the app does not clear it. Rebooting sometimes does (and sometimes doesn't — see the 07-05→07-08 window). This looks like something raced or wedged during extension/network startup rather than corrupted persistent state, which is what I incorrectly suspected at first.

Key evidence

  1. The forwarder's upstream queries never leave the machine. sudo tcpdump -i en0 and -i any filtered on port 53 or port 853 during probe queries to quad-100: zero packets for the probed names, while mDNSResponder's normal traffic to the LAN router flows on the same wire with instant answers. With DoH configured, netstat shows zero TCP connections to NextDNS anycast (45.90.28.0 / 45.90.30.0) over IPv4 or IPv6 — the DoH client never dials.
  2. The extension's networking is otherwise healthy while DNS is broken. tailscale netcheck: UDP true, STUN works over IPv4 and IPv6, portmap probes reach the LAN router (UPnP/NAT-PMP/PCP all answer), nearest DERP ~39 ms. Tunnel data path passes TCP fine (HTTP 200 from a tailnet peer's web UI).
  3. Every upstream answers instantly when queried from user space on the same machine: LAN router, ISP resolvers, 1.1.1.1, and NextDNS DoH (verified by raw IP with curl --resolve dns.nextdns.io:443:45.90.28.0 ...).
  4. MagicDNS names answered from tailscaled's memory work (NOERROR), so the DNS server and the client→quad-100 packet path are fine — the failure is strictly in the forwarder's upstream dials.

Ruled out by direct test

  • Third-party network extensions: DefensX DNS proxy (NEDNSProxyProvider) and Twingate (tunnel provider) are installed but were toggled off in System Settings → Network Extensions with their launchd daemons disabled and booted out, then rebooted — reproduced on that clean boot with only Tailscale's extension enabled. Both remained in that same disabled state (systemextensionsctl shows activated disabled) across ALL subsequent broken AND working boots, so their disabled-but-installed presence is constant across both outcomes and cannot be the discriminating variable. DefensX's own "bypass protection" mode made no difference while broken.
  • pf: disabled, only stock Apple anchors present.
  • macOS application firewall: toggling had no effect.
  • Tailscale state: full uninstall (system-extension removal confirmed) + reinstall, on two versions — identical failure immediately on fresh install during the broken window.
  • Transparent DNS interception: dig @192.0.2.55 (TEST-NET) times out as expected — nothing is intercepting/answering for absent servers.

Additional context

  • tailscale debug daemon-logs usually fails on this machine with The Tailscale GUI failed to start: (Tailscale.CLIError error 3.) even while the GUI is running (it connected exactly once, showing only netmap lines). Possibly related, possibly a separate CLI issue — mentioning in case it helps.
  • Current workaround: tailscale set --accept-dns=false plus /etc/resolver/<tailnet>.ts.net containing nameserver 100.100.100.100, which restores MagicDNS for apps while the OS uses router DNS.

The machine is in the broken state right now (marker above is from it) — happy to run any diagnostics or a debug build while it's wedged.

Activity

  1. added
    bug
    OS-macos
    on Jul 13, 2026
  2. added theissue type on Jul 13, 2026
  3. emersonbpc commented on Jul 28, 2026

    @emersonbpc

    Hi

    Wondering if you have any other insights on the possible cause - I have a user with MacOS Tahoe version 26.5.1 and tailscale 1.98.9 which had a noticeably laggy DNS lookup until accept dns was disable. the work around tailscale set --accept-dns=false plus /etc/resolver/<tailnet>.ts.net containing nameserver 100.100.100.100, which restores MagicDNS for apps while the OS uses router DNS. ended up working as a stop gap solution. and overall the issue seems similiar to yours here.

  4. multivac61 commented on Aug 9, 2026

    @multivac61

    I appear to be experiencing the same issue on macOS with Tailscale
    1.102.2.

    With accept-dns=true, the configured NextDNS resolver appears correctly
    in tailscale dns status, but both queries time out:

     dig google.com
     dig @100.100.100.100 google.com
    

    The NextDNS DoH endpoint resolves google.com correctly when queried
    directly. tailscale netcheck reports UDP connectivity as healthy.
    Setting accept-dns=false immediately restores DNS.

    Bug report:
    BUG-a0d7f3939672ef2c61268b3a0d7390619ee4456ab6448a15bfed6f97ee8ff887-20260809093922Z-0e4296f8191c2b24

  5. lirender commented on Aug 25, 2026

    @lirender

    Adding a data point on newer stable + newer macOS than the OP — Tailscale 1.102.1 (App Store build) on macOS 26.6.1 (25G76), Mac Studio M2 Max — including a live capture of the wedge with a bugreport marker taken while broken, and some scoping that narrows where the failure lives.

    Setup: MagicDNS on, accept-dns=true, no tailnet global resolvers (coordination server pushes only the default ts.net. split route, so "Override Local DNS" is not a factor). No exit node, no subnet routes in the DNS path. Single install (an old coexisting Homebrew tailscaled was fully removed weeks before these events, ruling out that confound). Desktop machine, no sleep-wake involved. Recurrence rate: four incidents in five days (two persistent wedges, two brief ~30–90 s stalls).

    Live capture — 2026-08-25 00:23 UTC, while wedged

    All of the following observed in the same ~2 minutes:

    • dscacheutil -q host -a name example.com → empty (no answer); Python socket.getaddrinfo("example.com", ...) → instant EAI_NONAME ("nodename nor servname provided"), no timeout. All getaddrinfo-based apps got ENOTFOUND-class failures (three separate Node CLI sessions showed "check your internet or DNS (ENOTFOUND)").
    • Meanwhile, direct queries to the forwarder succeeded: dig example.com @100.100.100.100 → NOERROR in 17 ms; a MagicDNS name via @100.100.100.100 → NOERROR; dig @8.8.8.8 → fine.
    • Unified logs at that moment show mDNSResponder's own querier traffic to quad-100 over the utun interface flowing normally with answers for some clients, several Unpenalizing responsive server lines (so it had recently penalized the server), and — for the failing lookups — questions do get Question assigned DNS service 1 yet return failure instantly with no wire query ever sent (consistent with the OP's tcpdump observation).
    • Earlier the same day the Tailscale utun had been rebuilt (utun4 → utun8), i.e. interface/DNS-config churn preceded the wedge.

    So in this state the quad-100 forwarder itself is provably healthy; the stall is inside mDNSResponder's question-resolution path, seemingly stuck state that fails certain questions instantly without querying. It smells like an mDNSResponder (macOS 26) bug triggered by Tailscale's DNS-configuration/interface churn — data that may help you escalate to Apple with a narrower repro.

    Recovery: sudo killall mDNSResponder restores everything instantly — no reboot, no Tailscale toggle (cheaper than what the OP found; tailscaled keeps running, a fresh mDNSResponder is enough).

    Other presentations seen this week

    • Persistent wedge where both paths die (public and ts.net names, dscacheutil failing): 2026-08-17 and 2026-08-21 ~03:09–03:17 UTC.
    • Brief stalls (~30–90 s) noticed only by long-running processes: 2026-08-23 15:55:11–15:56:27 UTC and 2026-08-24 05:39:15–05:39:50 UTC (exact timestamps from app logs). During the second, mDNSResponder's send/receive counts to quad-100 show only a small gap (270/264, 733/706 per 10-min bucket), zero SERVFAILs — so healthy-looking counters don't rule the problem out; victim queries simply never reach the wire.

    Bugreport markers:

    • BUG-cd3af7de46e5a7b0cabf831aef64b6e247e89e024e68ed2ad07d5011f01f2d97-20260825002323Z-8fed60eabe4de292 — taken during the live wedge above.
    • BUG-cd3af7de46e5a7b0cabf831aef64b6e247e89e024e68ed2ad07d5011f01f2d97-20260824152343Z-531f9ddbe15d22db — ~9h45m after the 2026-08-24 05:39 UTC stall.
    • BUG-cd3af7de46e5a7b0cabf831aef64b6e247e89e024e68ed2ad07d5011f01f2d97-20260824072203Z-964ceb4ec3e33a8c — 4 days after the 2026-08-21 persistent wedge (may have aged out).

    I have a capture script that records dig probes (quad-100 public + MagicDNS, @8.8.8.8 control), dscacheutil/getaddrinfo probes, scutil --dns, tailscale dns status, and a fresh bugreport marker while wedged — happy to run further diagnostics (tcpdump, packet-level, TSnet debug knobs) on the next occurrence.

  6. lirender commented on Aug 28, 2026

    @lirender

    Correction / retraction of my earlier report.

    I commented above attributing a recurring total-DNS-failure on macOS 26 to Tailscale. I've since found a local root cause on my machine, and Tailscale was not responsible. Retracting that attribution, and posting the details since the symptom points away from the actual cause and may be wasting other people's time here too.

    Actual cause in my case: a third-party menu-bar app (iMCP) was calling DNSServiceCreateConnection + DNSServiceBrowse roughly every 37s per process and never deallocating either. Each leaked connection pins a descriptor in mDNSResponder. Orphaned copies accumulated, and once mDNSResponder exhausted its descriptor table it refused all new client connections.

    Measured, via controlled reproduction:

    • ~1.7 leaked Unix sockets per process per minute, monotonic, never reclaimed
    • linear across 8 → 40 → 150 processes over 2.5h, no plateau
    • mDNSResponder wedged at ~12,540 open descriptors (lsof at the moment of failure)
    • recovery by killing the leaking processes: DNS answering in 1 second, mDNSResponder never restarted

    Why it looks like a resolver bug: dig and host keep working throughout (they bypass mDNSResponder), and long-lived processes that already hold an mDNS connection keep resolving normally — so the machine looks half-alive and the failure appears to follow whatever resolver is configured. It does not.

    Diagnostic that separates the two, for anyone else landing here:

    # is the system resolver actually wedged, or is it a stale client-side error?
    dscacheutil -q host -a name example.com     # EMPTY output == wedged (it always exits 0)
    dig @8.8.8.8 example.com                    # works either way — proves nothing on its own
    
    # who is leaking mDNS handles?
    log show --last 30m --info --predicate 'process == "mDNSResponder"' --style compact \
      | grep -E 'DNSServiceBrowse (START|STOP)' | grep -oE 'client pid: [0-9]+ \([^)]*\)' \
      | sort | uniq -c | sort -rn
    # then compare START vs STOP counts — a large imbalance from one client is your culprit
    log show --last 30m --predicate 'process == "mDNSResponder"' --style compact | grep -c 'read_msg errno 40'

    read_msg errno 40 (Message too long) is EMSGSIZE — on a Unix socket that's recvmsg failing to allocate descriptors for the SCM_RIGHTS being passed, i.e. mDNSResponder is out of descriptors, not the upstream resolver misbehaving.

    I've filed the leak with the app's author (mattt/iMCP#192) and re-enabled --accept-dns=true here; MagicDNS is working normally.

    One caveat so I'm not overclaiming: I have a proven reproduction for my most recent incident. Some earlier incidents on this machine had a different logged signature (no errno 40 at all) and remain unexplained — they may be the same resource exhaustion breaking a different path, or something else. Either way I no longer have evidence pointing at Tailscale, so I didn't want my earlier comment left standing as-is. Apologies for the noise.

  7. nickoneill commented on Nov 6, 2026

    @nickoneill
    Contributor

    @dszp can you retest this on 1.104.x? We've had a few DNS fixes since this was filed.

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

    OS-macosbugdns

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions