511 Network Authentication Required
You need to log in to the network before you can get online, typically on hotel, airport or cafe Wi-Fi with a captive portal.
What 511 Network Authentication Required means
Defined in RFC 6585 for captive portals. The network intercepts your request and replies with 511 and a page linking to its login or terms screen.
It comes from the network, not the website you were trying to reach. Origin servers should not send it.
Common causes
- Public Wi-Fi that requires you to sign in or accept terms.
- A network session that expired and needs a fresh login.
How to fix 511 Network Authentication Required
- Open any http:// page, or your device's network sign-in prompt, to reach the portal and log in.
- Disconnect and reconnect to the Wi-Fi if the portal does not appear.
- Turn off a VPN or custom DNS for a moment, since they can stop the portal from loading.
Example response
HTTP/1.1 511 Network Authentication Required
Content-Type: text/plain; charset=utf-8
511 Network Authentication RequiredHow to check for a 511 response
cURL
# Print only the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/JavaScript (Node.js)
const res = await fetch("https://example.com/");
if (res.status === 511) {
console.log(res.status, res.statusText);
}Python
import requests
res = requests.get("https://example.com/")
if res.status_code == 511:
print(res.status_code, res.reason)Go
res, err := http.Get("https://example.com/")
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 511 {
fmt.Println(res.Status)
}Specification
511 Network Authentication Required is defined in RFC 6585, section 6.
Related status codes
- 401
The request needs authentication. You are not logged in, or the credentials or token you sent are missing, invalid or expired.
- 407
A proxy between you and the website needs you to authenticate before it will forward your request.
- 403
The server understood the request but refuses to allow it. Logging in again will not help unless your account gets access.