LightAtom

NSURLErrorDomain Errors on Mac and iPhone: What Each Code Means

Apple apps and frameworks report networking failures as NSURLErrorDomain with a negative code. Each code names a specific problem: offline, timeout, DNS, TLS and so on.

NSURLErrorDomain

An app built on Apple's networking (URLSession) failed to load something. The number after the error, like -1009, tells you exactly what went wrong.

Quick checks

  • Find the code in the message (for example Code=-1001).
  • Check your connection and try again.
  • Update the app and macOS or iOS.

Fixes on Mac

  1. Common codes

    1. -1001 timed out: slow or blocked network; try another network.
    2. -1003 cannot find host: DNS failed; check the connection and DNS settings.
    3. -1004 cannot connect to host: server down or port blocked.
    4. -1005 the network connection was lost: Wi-Fi dropped or switched mid-request.
    5. -1009 not connected to the internet: no network, or the app's network access is blocked.
    6. -1022 App Transport Security requires a secure connection: the app tried plain HTTP.
    7. -1200 secure connection failed: TLS problem; check date and time, VPNs and proxies.
    8. -1202 server certificate untrusted: interception or a bad certificate.
  2. General fixes

    1. Turn off VPNs and content filters; check System Settings › Privacy & Security › Local Network for apps that talk to local devices.

Fixes on Windows

  1. Not applicable

    1. NSURLErrorDomain comes from Apple platforms only.

Other devices

  1. iPhone and iPad

    1. For -1009, check Settings › Cellular for apps with mobile data turned off.
    2. Toggle Airplane Mode and retry.

Still not working?

Developers: log the full NSError including NSUnderlyingError and _kCFStreamErrorCodeKey; for TLS failures, -9800-range stream errors identify the handshake problem. The full list is in NSURLError.h (URLError.Code in Swift).

See what’s happening

LightAtom's connections view shows the app's connections, so you can see whether it reaches its servers before it reports the error.

Frequently asked questions

What is NSURLErrorDomain?

The error domain Apple's URL loading system uses. Any app using URLSession reports network failures with it, plus a negative code identifying the problem.

What does error -1009 mean?

The device isn't connected to the internet, or the app isn't allowed to use the network (for example, mobile data turned off for that app on iPhone).

What does “the network connection was lost” (-1005) mean?

The connection dropped mid-request, often when Wi-Fi switches or reconnects, or a server closes a reused connection.

What does -1200 mean?

An SSL/TLS error prevented a secure connection. Check the date and time, VPNs and proxies; developers should check the server's TLS configuration.

LightAtom team

The people who build LightAtom, a network monitor for macOS.