← All status codes5xx – Server Error

HTTP 511 – Network Authentication Required

The client needs to authenticate to gain network access, e.g. a captive portal.

Common use case

Returned by network gateways for coffee-shop or airport Wi-Fi captive portals, telling the client's browser it must log in before internet access is granted.

Example

HTTP/1.1 511 Network Authentication Required

History

Standardised in RFC 6585 (2012), specifically to give captive portals a proper status code instead of hijacking DNS or silently rewriting traffic.

Did you know?

Before this code existed, captive portals achieved the same effect by intercepting and rewriting all traffic - a hacky and often broken approach that 511 was designed to replace.