A captive portal is a web page that users are redirected to when they first connect to a network — commonly seen in hotels, airports, and coffee shops. It typically requires authentication or agreement to terms before granting internet access.
Operating systems and browsers detect captive portals by making HTTP requests to known URLs. If the response is redirected or blocked, the device knows it's behind a captive portal and shows a login prompt.
To set up a captive portal on a local network, configure your DNS server to redirect these detection URLs to your portal's IP address:
172.16.42.1 captive.apple.com
172.16.42.1 connectivitycheck.gstatic.com
172.16.42.1 msftconnecttest.com
172.16.42.1 detectportal.firefox.com
Each operating system and browser checks a specific URL to detect internet connectivity:
captive.apple.com) — iOS and macOS check this endpointconnectivitycheck.gstatic.com) — Google's connectivity checkmsftconnecttest.com) — Microsoft's network connectivity status indicatordetectportal.firefox.com) — Firefox has its own detection, separate from the OSBy pointing these domains to your portal server (e.g., 172.16.42.1), the device detects a captive portal and automatically opens the login page.
172.16.42.1 with the IP address of your captive portal server on your local network.