Skip to content

On iOS, DNS over HTTPS resolver may randomly stop working when moving between network interfaces #12352

Open

Description

@agottardo

Quoting me on Slack:

I was just able to repro this at a theatre with public WiFi. I was using override public dns with a NextDNS resolver enabled, iOS was showing the encrypted DNS warning and DNS resolution was broken until I turned off CorpDNS or I switched to the corp tailnet, where DoH is not used.

Some assorted bug reports that show the issue:

BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20240602104734Z-690b0b8ca9f418f4
BUG-4f12dbf1c14e0d1ab236eab531eff35d0061a9fb53bcc6c113d70791e49b679f-20240601052301Z-3ae329ddafcba030

We don't have a 100% repro scenario yet.

@raggi suggests:

I suspect we need to set tighter timings on the DOH http conns, like short idletimeout, short headertimeout and so on, so we don’t hang on non-functional http conns to the doh resolvers

we should probably also issue a closeidleconns [...] when there’s a network change

Activity

  1. added
    OS-ios
    on Jun 5, 2024
  2. self-assigned this
    on Jun 5, 2024
  3. diegoscl commented on Jun 6, 2024

    @diegoscl

    🤚🏼 Same issue here! Actually, I have the same behavior on macOS...

  4. agottardo commented on Jun 6, 2024

    @agottardo
    ContributorAuthor

    @diegoscl please share a bug report identifier

  5. diegoscl commented on Jun 6, 2024

    @diegoscl

    BUG-09c56d312020bf87677d4af581598dde93d8cf9a4c253cd37bb6fe4b06c636b3-20240606230048Z-413ede8834151ef6

    My theory is that it happens especially when I switch between IPv4 (mobile or work ISP) and IPv6 (home ISP) internet connections.

  6. FinalPoint commented on Jul 6, 2024

    @FinalPoint

    I experienced another connectivity issue with Tailscale when moving off wifi and switching to cellular. Hard to tell if it’s the same issue or something completely different.

    The client was displaying two error messages:

    • Cannot connect to control server
    • Relay server unavailable

    version: 1.69.104

    Contrary to my previous issues, simply disabling and reenabling my exit node did not work. I had to disable Tailscale and reenable it to get back network connectivity.

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20240706104455Z-5a3fb985cbdda738

    cc: @agottardo

  7. FinalPoint commented on Jul 17, 2024

    @FinalPoint

    Another instance of lost connectivity after going out off wifi range and switching to cellular. This time, disabling and reenabling the exit node gave me back internet connectivity. No error message visible in the client.

    version: 1.69.156

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20240717181055Z-89deabe37da4ad91

    cc: @agottardo

  8. self-assigned this
    on Jul 18, 2024
  9. FinalPoint commented on Jul 25, 2024

    @FinalPoint

    Another one, just in case it can be useful: BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20240725225633Z-909f9df34c6499f9

    version: 1.70.0

  10. agottardo commented on Jul 26, 2024

    @agottardo
    ContributorAuthor

    @FinalPoint thank you for contributing these, this is really helpful.

  11. FinalPoint commented on Jul 26, 2024

    @FinalPoint

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20240726154837Z-a0d9d7a54371e7e7

  12. agottardo commented on Jul 26, 2024

    @agottardo
    ContributorAuthor

    @FinalPoint the last logs you sent indicate that upon switching from en0 (Wi-Fi) to pdp_ip (the Cellular interface), all network connections were failing with connect: network is unreachable, as if your cellular connection was unavailable. Not only DNS was failing, but also connections to the coordination server. The next time this happens and you hit a lack of DNS resolution, leave Tailscale enabled, then try to ping:

    • 1.1.1.1 or 8.8.8.8
    • your DNS resolver
    • another device on your tailnet, with its 100.x.y.z IP.

    You can do that using an app like Network Monitor or Scany. Let's make sure connectivity is actually working and it is an issue isolated to our DNS. [Really wish we could repro this on our side instead...] Thanks.

  13. FinalPoint commented on Jul 26, 2024

    @FinalPoint

    Will do.

    To get back connectivity, I tried disabling/reenabling my exit node in Tailscale. Doing so I got an error in the app that I don’t remember seeing before. Something about the kernel module not being available I think.

    After that, I think Tailscale disabled and reenabled the VPN, all by itself. And I was back in business.

    I didn’t need to switch to airplane mode or anything.

    Any guidelines about how long I have after the start of the problem for the bug report to be useful? I don’t always notice right away…. Also is there any manipulation I should avoid? For example is it important that I generate the report before I disable/reenable my exit node?

    Thanks!

  14. agottardo commented on Jul 26, 2024

    @agottardo
    ContributorAuthor

    When you generate a bug report identifier, it just adds a timestamp in our logs so we can look for the specific point in time when the issue started. Tailscale is always logging.

    Doing so I got an error in the app that I don’t remember seeing before. Something about the kernel module not being available I think.

    Would be really really useful to know what the error was. I think Tailscale disabled and reenabled the VPN, all by itself was actually a crash, which we automatically recovered from.

  15. agottardo commented on Jul 26, 2024

    @agottardo
    ContributorAuthor

    @diegoscl the issue on your device appears to have been caused by switching from NextDNS to ControlD, are you still experiencing it?

    dns udp query: resolving using "https://dns.controld.com/{redacted}": Post "https://dns.controld.com/{redacted}": tls: failed to verify certificate: x509: certificate is valid for dns.nextdns.io, *.dns.nextdns.io, not dns.controld.com
    
  16. FinalPoint commented on Aug 7, 2024

    @FinalPoint

    I just updated my iPhone to iOS 17.6.1. After the update things were working fine; I was able to verify that there was no update available for my Watch. I then proceeded to reboot my iPhone. After that reboot, I got no network connectivity.

    In the Tailscale app, I see "Connected' with a "warning" symbol (red triangle with an exclamation mark inside). And I get the new error banner saying "DNS UNAVAILABLE" "Tailscale can't reach the configured DNS servers. Internet connectivity may be affected."

    But the problem was not limited to DNS:

    • I was unable to ping my devices from the Tailscale app
    • An ICMP ping to an IP address (1.1.1.1) failed

    Disabling/enabling the VPN got everything back to normal

    version: 1.71.46

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20240807183042Z-05ca050d7de444f9

  17. FinalPoint commented on Aug 28, 2024

    @FinalPoint

    Not sure this issue is the right place for my latest problem. But in case it’s related:

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20240828001951Z-4544493d19b1b79b

    version : 1.73.19

    In the app, I had the following error:
    Magicsock Function Not Running

    The MagicSock function ReceiveDERP is not running. You might experience connectivity issues.

    code: magicsock-receive-func-error

    Magicsock Function Name: ReceiveDERP

    Restarting the VPN got things working again.

  18. FinalPoint commented on Aug 28, 2024

    @FinalPoint

    And, a bit later when I got back to my home wifi: No connectivity, and not only one but three (3) errors at the same time in the app:

    Dns Unavailable
    Tailscale can't reach the configured DNS servers.
    Internet connectivity may be affected.
    Code: dns-forward-failing

    Magicsock Function Not Running
    The MagicSock function ReceiveDERP is not running. You might experience connectivity issues.
    Code: magicsock-receive-func-error
    Magicsock Function Name: ReceiveDERP

    Relay Server Timed Out
    Tailscale hasn't heard from the 'Toronto' relay server in 2m17s. The server might be temporarily unavailable, or your Internet connection might be down.
    Code: derp-timed-out
    Duration: 2m17s
    DERP Region Name: Toronto
    DERP Region ID: 21

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20240828011759Z-19736084ffb126d9

  19. FinalPoint commented on Sep 15, 2024

    @FinalPoint

    Another instance where I lost network connectivity after switching network. This time, switching from cellular to Wi-Fi.

    First report from iOS 18 (Release Candidate)
    Tailscale version 1.74.0

    in the app, the warning I got was: “DNS Unavailable”

    But I had no connectivity. I wasn’t able to ping and IPv4 address (1.1.1.1)

    When I tried to disable and reenable my exit node, I got the warning: “MagicSock Function Not Running”. That lasted about 30 seconds. After which I didn’t have any warnings. But I still wasn’t able to reach anything.

    Disabling and restarting the VPN got things working normally.

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20240915174336Z-1ffef0344638da14

  20. FinalPoint commented on Oct 3, 2024

    @FinalPoint

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20241003093318Z-7eab4c3818d7a20f

    Tailscale version: 1.75.44

    Lost Internet connectivity (couldn't ping 1.1.1.1) after switching from WiFi to cellular.

    The app was showing two warning at the same time:

    • Relay Server Unavailable (Code: no-derp-connection)
    • DNS Unavailable (Code: dns-forward-failing)

    Disabling and restarting the VPN got things working normally.

  21. FinalPoint commented on Oct 28, 2024

    @FinalPoint

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20241028203216Z-c0d9c5636a7cc9f4

    Tailscale version: 1.76.1

    The app was showing three warnings at the same time:

    • DNS Unavailable (Code: dns-forward-failing)
    • Relay Server Unavailable (Code: no-derp-connection)
    • Out Of Sync (not-in-map-poll)

    Disabling and restarting the VPN got things working normally.

  22. FinalPoint commented on Oct 30, 2024

    @FinalPoint

    BUG-b64e902406c500582fcd230df9d19fb2e34b9d872664e2c3622c3c8306fecfd7-20241030151723Z-08052890d54bd22b

    Tailscale version: 1.76.1

    The app was showing two warnings at the same time:

    Relay Server Unavailable (Code: no-derp-connection)
    DNS Unavailable (Code: dns-forward-failing)

    Disabling and restarting the VPN got things working normally.

  23. jpelchat commented on Mar 24, 2025

    @jpelchat

    Came across another report of this today in TSS-55068. User provided the following bug report:
    BUG-8f193f08f17ebc5d850959cd7e5236b8e1f36841bede41b623d37bf94ac3ba1c-20250322181502Z-fc8dda23182b8527

    OS version: iOS 18.3.2
    Tailscale version: 1.80.2

    Same behaviour as above. When switching to a mobile network, cannot ping 8.8.8.8, DNS forwarding error presented in client, all connectivity lost.

  24. Esras commented on Mar 25, 2025

    @Esras

    BUG-410ed77e339997670c97f7293e04e943958c1e6bd54a13f9c17f02b3b4f25482-20250323192043Z-b3d7efffe17e7be2

    iOS: 18.3.2
    Tailscale Version: 1.80.2 (Maybe, I think I did an update since that was generated a couple of days ago).

  25. m5r commented on May 18, 2025

    @m5r

    BUG-4b25ea9f45fa43bd05710b0b2b3566ebb30a3377006b7a2df7a990d09dd156ed-20250518125550Z-21550553ddc183ea

    iOS: 18.4.1
    Tailscale version: 1.82.0

  26. jenks6797 commented on Nov 17, 2025

    @jenks6797

    I am having the same issue ever since I started using a Mullvad exit node on my iPhone and on my NAS which is running an Adguard Home docker container (not sure which of those changes or both caused the issue).

    But basically, whenever I leave my home wifi network and connect to cellular, when I come back home and connect to wifi I get an error that either says DNS Unavailable or Magicsock Function Not Running.

    Bug report BUG-9d3b5c9e58a84752650cf01e0309b1c23fbf8caa2b85924f7b184becec7dd275-20251117211502Z-8ef26560625eee32

    iOS 26.1
    Tailscale 1.90.4

  27. mikeodr commented on Jan 6, 2026

    @mikeodr
    Contributor

    Adding a users report of this to the pile:

    BUG-ee922fa1e649e8376120dae2c5efadd12f19bf8458d62256b307a662819832c0-20260106002810Z-a9170c9b6df4348e

    With Controld.

  28. timglong commented on Feb 21, 2026

    @timglong

    I believe I just encountered this issue while switching from Wifi to cellular. I received this warning: Tailscale can't reach the configured DNS servers. Internet connectivity may be affected. Code: dns-forward-failing

    Steps to reproduce:

    • Connect to Wifi.
    • Connect to Tailscale.
    • Disable Wifi.
    • Attempt to load a webpage, or attempt to ping the phone using tailscale ping client.

    The reverse also appears to create the problem (start on cellular then connect to Wifi).

    Disabling and re-enabling Tailscale seems to clear the problem (immediate ping response).

    I noticed the behavior was not entirely consistent. At one point I was able to ping the phone immediately after switching from Wifi to cellular, but the client then showed a DNS error and the next ping command resulted in a timeout.

    iPhone 16 Pro
    iOS 26.2.1
    Tailscale 1.94.1

    BUG-74c043435ab68651270f31e1857fb39f871092ea9b2d6f8bab3ebe5be7e86f73-20260221164024Z-74c8441ab4032c4f

    Edit: I'm using two Pi-holes as global nameservers and I see a number of blocked queries to _dns.resolver.arpa in the logs. This Pi-hole discussion might be relevant? I'm not sure why disabling and re-enabling Tailscale clears the issue, though.

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

Metadata

Metadata

Assignees

Labels

OS-ios

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions