# HTTP 511 Network Authentication Required — Meaning, Causes & Fixes

> You need to sign in to the network — a captive portal — before you can reach the internet.

511 (RFC 6585) is the code captive portals should use — the sign-in pages on hotel, airport and café Wi-Fi. Instead of hijacking your request with a fake 200 or a redirect, the network answers 511 with a link to its login page, so apps know they're not talking to the real server.

- Class: 5xx Server Error
- Retry: Not applicable
- Cacheable by default: no
- Defined in: [RFC 6585 §6 — 511 Network Authentication Required](https://www.rfc-editor.org/rfc/rfc6585#section-6)

## Example response

```http
HTTP/1.1 511 Network Authentication Required
Content-Type: application/json
Content-Length: 43

{"error":"Network Authentication Required"}
```

## Common causes

- Joining public Wi-Fi that requires accepting terms or logging in.

## How to fix it

1. Open any `http://` page in a browser to trigger the portal, sign in, then retry.
2. Apps must never cache a 511 response as if it came from the origin.

## FAQ

### Why don't all captive portals use 511?

Many predate it and still use redirects. Operating systems detect portals by probing known URLs (Apple's captive.apple.com, for example) rather than relying on 511.

## Related status codes

- [401 Unauthorized](https://www.devkult.com/http/401.md)
- [407 Proxy Authentication Required](https://www.devkult.com/http/407.md)
- [302 Found](https://www.devkult.com/http/302.md)

Open the interactive page: https://www.devkult.com/http/511