Skip to main content

Apple CNA, Android Connectivity Check, Microsoft NCSI: How Captive Portal Detection Actually Works

This definitive technical reference explains how Apple CNA, Android connectivitycheck, and Microsoft NCSI detect captive portals. It provides actionable guidance for IT managers and network architects on walled garden configuration, common failure modes, and best practices for seamless deployment.

📖 5 min read📝 1,178 words🔧 2 examples3 questions📚 8 key terms

🎧 Listen to this Guide

View Transcript
Apple CNA, Android Connectivity Check, Microsoft NCSI: How Captive Portal Detection Actually Works A Purple WiFi Technical Briefing --- INTRODUCTION AND CONTEXT — approximately 1 minute Welcome to the Purple Technical Briefing series. I'm your host, and today we're getting into something that sits at the very heart of every guest WiFi deployment — captive portal detection. Specifically, we're looking at how Apple, Android, and Windows each decide, the moment a device joins your network, whether a captive portal is present and whether they should show it to the user. This matters enormously in practice. Get it wrong, and your guests connect to the network but never see the splash page. Or they see it twice. Or Windows loops endlessly on the sign-in prompt. These are real, recurring support tickets across hotels, stadiums, retail chains, and conference centres. And the root cause, almost every time, is a misconfigured walled garden or a misunderstanding of how these three OS families actually behave differently from one another. So let's get into it. --- TECHNICAL DEEP-DIVE — approximately 5 minutes Let's start with Apple, because Apple's Captive Network Assistant — the CNA — is probably the most widely discussed and the most frequently misunderstood. When an Apple device, whether that's an iPhone, iPad, or Mac, joins a new WiFi network, the operating system immediately fires off an HTTP GET request. On modern iOS and macOS, that probe goes to captive.apple.com, specifically the path /hotspot-detect.html. The device is expecting a very specific response: an HTTP 200 with a body that reads, verbatim, "Success" wrapped in basic HTML tags. If it gets that exact response, the OS concludes it has full internet access and does nothing further. No portal, no pop-up. But if the response is anything other than that — a redirect, a different body, a timeout — the CNA kicks in. It opens what Apple calls WebSheet, which is a sandboxed mini-browser. Not Safari. Not Chrome. A locked-down browser window that has no access to Safari extensions, cannot save passwords, and on macOS is fixed at roughly 900 pixels wide. This is important for portal designers: your splash page must render correctly in that constrained environment. Now here's the first critical nuance. The CNA probe is HTTP, not HTTPS. If your captive portal gateway intercepts that probe and redirects it to an HTTPS URL, the CNA will not handle it gracefully. The user will see a certificate warning, or the portal simply won't open. Your redirect must stay on HTTP port 80 for the initial probe interception. The second nuance: if your walled garden passthrough list includes captive.apple.com and allows it to reach the real Apple server, the device will get the genuine "Success" response, conclude it has internet, and never show the portal. This is a classic misconfiguration — operators add captive.apple.com to their passthrough list thinking they're helping, but they're actually bypassing their own portal. Apple has also been rolling out support for RFC 8910, the Captive Portal API, which uses DHCP option 114 to signal portal presence positively rather than relying on probe interception. iOS 16 and later support this. It's a cleaner mechanism, but it requires your DHCP server or access point to advertise the option — something most legacy deployments don't yet do. Now let's move to Android. Android's connectivity check works on a fundamentally different principle. Instead of expecting a specific body text in an HTTP 200 response, Android expects an HTTP 204 — that's 204 No Content. The primary probe URL is connectivitycheck.gstatic.com/generate_204. Secondary probes go to clients2.google.com/generate_204 and connectivitycheck.android.com. When Android fires that probe and receives a 204, it concludes: internet is available, no portal. When it receives anything else — a redirect, a 200 with content, a timeout — it flags the network as requiring sign-in and shows the user a notification: "Sign in to WiFi network." Tapping that notification opens the full Chrome browser, not a sandboxed mini-browser. This is a significant difference from Apple. Android users get the full browser experience, which means your portal can use JavaScript, cookies, and modern CSS without the constraints of CNA's WebSheet. The critical walled garden implication for Android: if you block connectivitycheck.gstatic.com entirely — don't allow it through at all — Android doesn't detect a captive portal. Instead, it shows "Connected, no internet." The user sees the WiFi icon with an exclamation mark and has no idea a portal exists. You must allow the probe URL through your walled garden but intercept it with a redirect rather than blocking it outright. Android 11 introduced support for RFC 7710 bis and the Captive Portal API via DHCP option 114, mirroring Apple's approach. If the DHCP handshake includes the API URL, Android fetches it immediately and prompts the user to log in. This is more reliable than probe interception, but again requires infrastructure support. Now, Windows. And this is where things get interesting, because Windows uses a dual-probe mechanism that trips up a lot of deployments. Windows Network Connectivity Status Indicator — NCSI — runs two checks simultaneously when a device joins a network. First, an HTTP probe: GET request to http://www.msftconnecttest.com/connecttest.txt, expecting a 200 response with the body text "Microsoft Connect Test". Second, a DNS probe: it resolves dns.msftncsi.com and expects a specific IPv6 address in response — fd3e:4f5a:5b81::1. If the HTTP probe is redirected, Windows detects a captive portal and opens the default browser — Edge, in modern deployments — pointing it at the portal URL. This part works fine. The problem is what happens after authentication. Here's the Windows looping scenario, which I see in support tickets regularly. User authenticates on the portal. The portal marks their MAC address as authorised. But Windows then re-runs its NCSI probes. If msftconnecttest.com is still being intercepted — perhaps because the gateway hasn't yet propagated the MAC authorisation — Windows concludes the portal is still active and opens the browser again. The user has to sign in a second time, or sometimes a third. This loop continues until the gateway correctly passes NCSI traffic for that client. The fix is straightforward but requires attention: ensure your gateway propagates MAC authorisation immediately and that post-auth traffic to msftconnecttest.com and dns.msftncsi.com passes through cleanly. Also worth noting: older Windows versions used www.msftncsi.com rather than msftconnecttest.com. If you're supporting Windows 7 or 8 clients — yes, they still exist in enterprise and public-sector environments — you need both domains in your walled garden. --- IMPLEMENTATION RECOMMENDATIONS AND PITFALLS — approximately 2 minutes Let me give you the practical implementation framework. Your walled garden — the list of hosts accessible before authentication — must cover all three OS probe sets. At minimum, that means: captive.apple.com and www.apple.com for Apple; connectivitycheck.gstatic.com, clients2.google.com, and connectivitycheck.android.com for Android; and www.msftconnecttest.com, dns.msftncsi.com, and www.msftncsi.com for Windows. Do not allow these hosts to reach their real destinations. Allow the DNS resolution to succeed, but intercept the HTTP traffic and redirect it to your portal. The distinction matters: DNS must resolve, HTTP must redirect. For the portal itself, always serve the initial redirect on HTTP port 80. Your portal login page can be HTTPS — and should be, for credential security — but the initial interception and redirect must happen over HTTP. Apple's CNA will not follow an HTTPS redirect. Test with all three OS families before go-live. The most common gap I see is teams testing on their own iPhones and declaring the portal working, without ever checking Windows or Android. A quick test matrix: iPhone on iOS 16+, Android on a stock Google device, and a Windows 10 or 11 laptop. Run each one, check that the portal appears, complete authentication, and verify the device shows full internet connectivity afterwards. If you're running a Purple WiFi deployment, the platform handles walled garden configuration automatically and maintains an updated host list as Apple, Google, and Microsoft update their probe endpoints. This matters because these URLs do change — Google has updated its probe URLs across Android versions, and Microsoft shifted from msftncsi.com to msftconnecttest.com in Windows 10. --- RAPID-FIRE Q AND A — approximately 1 minute Question: My Apple users see the portal on first connect but not on reconnect. Why? Answer: iOS caches the captive portal state per SSID. Once authenticated, the device remembers that network as "internet available." If you want to re-prompt on reconnect, you need to clear the MAC authorisation on your gateway, which forces the device to re-probe. Some venues do this on a timer — say, 24 hours — for daily re-authentication. Question: Android shows "Connected, no internet" even though the portal is working for Apple users. What's wrong? Answer: Your walled garden is blocking connectivitycheck.gstatic.com rather than redirecting it. Add it to your passthrough list but ensure the gateway intercepts and redirects the HTTP traffic. Question: Can I use HTTPS for my entire portal, including the initial redirect? Answer: No. The initial interception must be HTTP. You can redirect from HTTP to HTTPS for the login page itself, but the first redirect from the probe URL must be plaintext HTTP. Otherwise Apple CNA won't trigger, and users will see certificate warnings. --- SUMMARY AND NEXT STEPS — approximately 1 minute To wrap up: Apple CNA, Android Connectivity Check, and Microsoft NCSI are three distinct mechanisms with different probe URLs, different expected responses, and different failure modes. Apple expects HTTP 200 with a specific body. Android expects HTTP 204. Windows runs a dual HTTP and DNS probe and is vulnerable to post-auth looping if your gateway is slow to propagate authorisation. Your walled garden must cover all three probe sets. Your initial redirect must be HTTP. And you should test with all three OS families before any deployment goes live. If you want to go deeper on the RFC 8910 Captive Portal API — the future of this space — or on how Purple WiFi automates walled garden management across multi-vendor infrastructure, head to purple.ai. The Guest WiFi and WiFi Analytics documentation covers the full technical architecture. Thanks for listening. We'll be back with another technical briefing shortly.

header_image.png

Executive Summary

Captive portal detection is a critical yet frequently misunderstood component of enterprise networking. When a device joins a public WiFi network, the operating system runs a series of background probes to determine if internet access is available or if a captive portal is intercepting traffic. Apple, Android, and Windows each use distinct mechanisms—with different probe URLs, expected responses, and failure modes.

For IT managers and network architects deploying Guest WiFi solutions in Hospitality , Retail , or public-sector environments, misconfiguring these detection mechanisms leads to significant support overhead. Guests may see certificate warnings, fail to see the splash page, or experience endless sign-in loops. This reference guide provides the definitive technical architecture of Apple CNA, Android Connectivity Check, and Microsoft NCSI, equipping you with the actionable knowledge required to build robust, vendor-neutral walled gardens and ensure a seamless connection experience.

Technical Deep-Dive

Apple Captive Network Assistant (CNA)

When an Apple device (iOS or macOS) connects to a network, it immediately sends an HTTP GET request to its primary probe URL: http://captive.apple.com/hotspot-detect.html. The device expects an HTTP 200 OK response with a specific HTML body containing the word "Success" [1].

If the response matches this expectation, the OS assumes full internet access. If the response is anything else—such as an HTTP 302 redirect or a timeout—the OS triggers the Captive Network Assistant (CNA). The CNA opens WebSheet, a sandboxed mini-browser with limited functionality (no Safari extensions, no password saving) [2].

Critical constraint: The initial probe is HTTP. If your gateway intercepts the probe and redirects to an HTTPS URL, the CNA will fail gracefully, often resulting in a certificate warning or a blank screen. The initial redirect must remain on HTTP port 80. Furthermore, if you inadvertently allow captive.apple.com through your walled garden, the device will reach the real Apple server, receive the "Success" response, and bypass your portal entirely.

Android Connectivity Check

Android operates on a different principle. Its primary probe targets http://connectivitycheck.gstatic.com/generate_204 (with fallbacks to clients2.google.com and connectivitycheck.android.com). Instead of expecting an HTTP 200 response with specific content, Android expects an HTTP 204 No Content response [3].

If Android receives an HTTP 204, it assumes internet connectivity. If it receives a redirect or an HTTP 200 response, it flags the network as captive and displays a "Sign in to WiFi network" notification. Tapping this notification opens the full Chrome browser, allowing for a richer portal experience compared to Apple's sandboxed CNA.

Critical constraint: If your walled garden blocks connectivitycheck.gstatic.com entirely rather than intercepting and redirecting it, Android will display a "Connected, no internet" warning and will not prompt the user to sign in.

Microsoft Network Connectivity Status Indicator (NCSI)

Windows employs a dual-probe mechanism via the Network Connectivity Status Indicator (NCSI) service. Upon connection, Windows performs an HTTP GET request to http://www.msftconnecttest.com/connecttest.txt (expecting a 200 response with the text "Microsoft Connect Test") and a DNS resolution for dns.msftncsi.com [4].

If the HTTP probe is intercepted, Windows detects the portal and opens the default browser (Edge). However, Windows is prone to a post-authentication looping issue. After the user authenticates, Windows re-runs the NCSI probes. If the gateway has not yet propagated the MAC address authorisation, the probe is intercepted again, and Windows re-opens the portal, forcing the user into a sign-in loop.

os_detection_comparison.png

Implementation Guide

To ensure reliable captive portal detection across all devices, you must configure your pre-authentication zone (walled garden) to handle the specific requirements of each OS.

walled_garden_architecture.png

Walled Garden Configuration

Your walled garden must include the following hosts. Crucially, you must intercept and redirect HTTP traffic to these hosts, rather than simply allowing them to pass through to the internet.

  • Apple: captive.apple.com, www.apple.com, www.appleiphonecell.com, www.itools.info
  • Android: connectivitycheck.gstatic.com, clients2.google.com, connectivitycheck.android.com
  • Windows: www.msftconnecttest.com, dns.msftncsi.com, www.msftncsi.com (for legacy clients)

Deployment Steps

  1. Configure DNS Resolution: Ensure that DNS requests for the probe URLs resolve successfully within the pre-authentication zone.
  2. Intercept HTTP Probes: Configure your gateway to intercept HTTP GET requests to the probe URLs and return an HTTP 302 redirect to your portal's splash page.
  3. Maintain HTTP for Initial Redirect: The initial redirect must be served over HTTP (port 80). You may redirect the user to an HTTPS login page subsequently, but the first hop must be plaintext HTTP to satisfy Apple CNA.
  4. Propagate Authorisation Rapidly: Ensure your gateway immediately updates its firewall rules upon successful authentication to allow NCSI probes to pass through, preventing Windows loops.

Best Practices

  • Adopt RFC 8910 (Captive Portal API): Modern operating systems (iOS 16+, Android 11+) support DHCP option 114, which provides a positive signal of a captive portal's presence via a designated API URL [5]. This eliminates reliance on probe interception and is the recommended future-proof approach.
  • Test Across All Platforms: Never assume a portal works based solely on testing with an iPhone. Mandate a testing matrix that includes iOS, stock Android, and Windows 10/11 devices.
  • Leverage Automated Platforms: Managing evolving probe URLs manually is error-prone. Platforms like Purple automatically update walled garden definitions as Apple, Google, and Microsoft modify their infrastructure, ensuring consistent WiFi Analytics data collection.

Troubleshooting & Risk Mitigation

Symptom Root Cause Resolution
Apple CNA fails to open; user sees SSL warning. Gateway intercepts probe and redirects directly to HTTPS. Ensure the initial interception and redirect use HTTP port 80.
Apple device connects without showing portal. captive.apple.com is allowed through the walled garden to the internet. Remove captive.apple.com from the allowlist; ensure it is intercepted.
Android shows "Connected, no internet". connectivitycheck.gstatic.com is blocked by the firewall. Allow the probe URL in the walled garden, but intercept and redirect it.
Windows prompts user to sign in multiple times (looping). Gateway is slow to apply post-authentication MAC rules; NCSI is still intercepted. Optimise gateway rule propagation; ensure msftconnecttest.com passes post-auth.

ROI & Business Impact

A robust captive portal detection architecture directly impacts the bottom line. In a 500-room hotel or a large retail environment, captive portal failures generate a disproportionate volume of IT support tickets. By eliminating these friction points, venues reduce support overhead, improve guest satisfaction scores, and increase the capture rate of first-party data.

When users seamlessly connect, they engage with your splash pages, enabling you to deliver targeted marketing, integrate with loyalty programs, and drive measurable revenue—as detailed in our guide to Indoor Positioning System: UWB, BLE, & WiFi Guide . For venues operating internationally, a reliable portal ensures consistent compliance data collection, supporting frameworks discussed in the Brazil LGPD and Guest WiFi: A Compliance Guide .


References

[1] Apple Support, "Use captive Wi-Fi networks on your iPhone or iPad," 2024. [2] SecureW2, "What Is Apple Captive Network Assistant?," 2023. [3] Android Developers, "Captive portal API support," Android 11 Features, 2020. [4] Microsoft Learn, "Captive Portal Detection and User Experience in Windows," Windows Hardware Developer, 2025. [5] IETF, "RFC 8910: Captive-Portal Identification in DHCP and Router Advertisements," 2020.

Key Terms & Definitions

Captive Network Assistant (CNA)

Apple's built-in mechanism for detecting captive portals and displaying them in a sandboxed mini-browser (WebSheet) rather than the full Safari browser.

IT teams must ensure their splash pages are responsive and do not rely on advanced browser features, as the CNA environment is highly constrained.

Network Connectivity Status Indicator (NCSI)

The Windows service responsible for determining internet connectivity by probing specific Microsoft domains via HTTP and DNS.

Understanding NCSI is critical for preventing the common 'Windows looping' issue where users are repeatedly prompted to sign in.

Walled Garden

A restricted network environment that allows unauthenticated users access to a specific list of approved hostnames or IP addresses.

Properly configuring the walled garden is the foundation of captive portal deployment, ensuring OS probes are handled correctly.

HTTP 204 No Content

An HTTP status code indicating the server successfully processed the request but is not returning any content.

This is the specific response Android devices expect from `connectivitycheck.gstatic.com` to confirm full internet access.

RFC 8910 (Captive Portal API)

An IETF standard that uses DHCP option 114 to explicitly notify a device of a captive portal's presence and provide the portal URL.

This modern standard replaces unreliable probe interception and is supported by newer versions of iOS and Android.

WebSheet

The sandboxed, limited-functionality mini-browser used by Apple's CNA to render captive portal splash pages.

Portal designers must test their pages in WebSheet, as it lacks features like password saving and full cookie support found in standard browsers.

MAC Authorisation

The process by which a gateway grants network access to a specific device based on its Media Access Control address after successful portal authentication.

Delays in applying MAC authorisation cause post-authentication probes (like Windows NCSI) to fail, leading to poor user experiences.

Probe Interception

The technique of capturing an operating system's background connectivity check and forcibly redirecting it to a captive portal login page.

This is the legacy, yet most common, method for triggering captive portals, requiring precise HTTP 302 redirects.

Case Studies

A 300-room hotel reports that guests using iPhones are connecting to the guest WiFi but are not being prompted with the captive portal splash page. Android and Windows users are unaffected.

  1. Review the walled garden (pre-authentication) allowlist on the gateway.
  2. Identify that captive.apple.com has been added as a permitted passthrough host.
  3. Remove captive.apple.com from the passthrough list.
  4. Configure the gateway to intercept HTTP requests to captive.apple.com and redirect them (via HTTP 302) to the portal URL.
Implementation Notes: This is a classic misconfiguration. By allowing `captive.apple.com` to reach the internet, the Apple device receives the expected 'Success' response and assumes no portal is present. Removing it forces the interception required to trigger the CNA.

A conference centre's IT team receives complaints that Windows 11 users are authenticating successfully but are immediately prompted to sign in again, creating an endless loop.

  1. Verify that the captive portal gateway is successfully authorising the client's MAC address post-authentication.
  2. Inspect the post-authentication firewall rules to ensure traffic to www.msftconnecttest.com and dns.msftncsi.com is permitted.
  3. Adjust the gateway configuration to ensure MAC authorisation is applied instantaneously, preventing subsequent NCSI probes from being intercepted.
Implementation Notes: Windows NCSI re-evaluates connectivity after authentication. If the gateway lags in updating its rules, the NCSI probe is intercepted again, causing Windows to assume the portal is still active. Rapid rule propagation is essential.

Scenario Analysis

Q1. You are deploying a captive portal for a large retail chain. The security team insists that all network traffic, including the initial portal redirect, must be encrypted using HTTPS. What is the technical implication of this policy?

💡 Hint:Consider how Apple's Captive Network Assistant (CNA) handles initial probe requests.

Show Recommended Approach

Enforcing HTTPS for the initial redirect will break Apple CNA detection. The CNA probe is an HTTP GET request. If the gateway intercepts this and redirects to an HTTPS URL, the CNA will not follow the redirect gracefully, resulting in a certificate error or a failure to open the portal. The initial interception must use HTTP port 80; the user can subsequently be redirected to an HTTPS page for authentication.

Q2. A stadium network engineer reports that Android devices are showing a 'Connected, no internet' warning without prompting the user to sign in. How should the walled garden be adjusted?

💡 Hint:Think about the difference between blocking a probe and intercepting it.

Show Recommended Approach

The engineer needs to ensure that connectivitycheck.gstatic.com is allowed to resolve via DNS within the walled garden, but the HTTP traffic must be intercepted and redirected. Currently, the firewall is likely dropping the traffic entirely, causing Android to assume the internet is down rather than detecting a captive portal.

Q3. A venue wishes to implement RFC 8910 (Captive Portal API) to improve the user experience. What infrastructure changes are required to support this?

💡 Hint:RFC 8910 relies on a positive signal during the IP assignment phase.

Show Recommended Approach

The venue must update its DHCP server or access points to advertise DHCP option 114. This option must provide the URL of the Captive Portal API endpoint. When compatible devices (iOS 16+, Android 11+) receive this option during the DHCP handshake, they will immediately fetch the API and prompt the user, bypassing the need for HTTP probe interception.