Web Design

Captive Portals

DNS entries for local network captive portal redirects

What is a Captive Portal?

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.

DNS Entries

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:

DNS Configuration
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

How It Works

Each operating system and browser checks a specific URL to detect internet connectivity:

  • Apple devices (captive.apple.com) — iOS and macOS check this endpoint
  • Android / Chrome (connectivitycheck.gstatic.com) — Google's connectivity check
  • Windows (msftconnecttest.com) — Microsoft's network connectivity status indicator
  • Firefox (detectportal.firefox.com) — Firefox has its own detection, separate from the OS

By 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.

Replace 172.16.42.1 with the IP address of your captive portal server on your local network.