Skip to content
iplogs.comSign up

iCloud Private Relay IP ranges: Apple's egress list and how to use it

By Muntaha Shaheen · · 7 min read

Apple publishes the iCloud Private Relay IP ranges at mask-api.icloud.com/egress-ip-ranges.csv, one IP prefix per line with country, region and city. These are egress addresses, the ones your server sees after the second relay. The file has five comma-separated columns and no header row, and it carries both IPv4 and IPv6 prefixes, most of them IPv6. To check a visitor, resolve the real client address through trusted proxies, then match it against the prefixes, or read the relay flag from an IP check API such as iplogs.com. Apple publishes the list so websites can geolocate relay traffic. The region it carries is reliable, and the city is approximate. Websites should not block Private Relay. Apple validates the device and iCloud+ subscription behind every connection and applies its own rate limiting. Treat relay addresses like large shared carrier addresses, key rate limits on the session or account, and add a light challenge only when other signals look bad.

From Apple's published list to a handling decision

  1. Apple publishes the egress list

    One IP prefix per line with country, region and city, for IPv4 and IPv6.

  2. Resolve the real client address

    Through your trusted proxies, then match it against the prefixes.

  3. Treat it as a shared address

    Allow browsing, key rate limits on the session or account, and use the region for localisation.

  4. Add friction only for other signals

    Such as email verification when email, device or behaviour look bad, not a block for the relay alone.

Relay addresses are shared, so judge the session, not the address.

iCloud Private Relay hides an Apple user's real IP address behind a relay address, and unlike most privacy services, Apple tells the world which addresses those are. That makes Private Relay one of the easiest privacy tools to recognise. Deciding what to do about it takes more thought, and Apple's own advice is to change very little.

Where does Apple publish the Private Relay IP ranges?

In one public CSV file at https://mask-api.icloud.com/egress-ip-ranges.csv, linked from Apple's developer page "Prepare your network or web server for iCloud Private Relay". Apple publishes it so websites can geolocate relay traffic: the page tells server operators to ask their IP database provider to update its feeds, or to download the latest set of addresses and locations directly.

These are egress addresses, the ones your server sees. Private Relay sends each request through two relays: the first, run by Apple, sees the user's IP but not the destination; the second, run by a third-party content provider, assigns a temporary IP and connects to the site. Cloudflare has said it operates as one of those second relays. The egress list covers the second hop.

What is the format of egress-ip-ranges.csv?

Five comma-separated columns with no header row: IP prefix, ISO country code, region code, city, and a final column that is always empty. That is the layout RFC 8805 defines for geolocation feeds (ip_prefix,alpha2code,region,city,postal_code), where the postal code is deprecated. A few real lines:

172.224.226.0/27,GB,GB-EN,London,
172.224.226.32/31,GB,GB-SC,Aberdeen,
104.28.28.1/32,AU,AU-NSW,Sydney,
2a02:26f7:b000:4000::/64,US,US-AK,Anchorage,
2606:54c0:8::/45,AE,,,

When we downloaded it on 27 October 2026, the file was about 12 MB and held 285,129 prefixes: 41,768 IPv4 and 243,361 IPv6, across 235 country codes. Most IPv4 rows are a single address (/32) or a pair (/31); most IPv6 rows are /64. Some rows carry only a country, like the last line above.

The file changes, and the server sends cache-control: max-age=3600 with an ETag. Refresh it at least daily and keep the last good copy if a download fails. Don't validate the region column strictly either: RFC 8805 expects ISO 3166-2 codes, but the file uses values such as GB-EN for England.

Plan for IPv6 and for sharing. Cloudflare notes that Private Relay egress prefers IPv6 when the site has an AAAA record, and that the IPv6 addresses are geolocated more precisely. Apple says one relay address may serve more than one user in the same area, and that the address stays stable during a browsing session on your site.

How do I check if an IP is iCloud Private Relay?

There are three practical ways. You can match addresses against Apple's file yourself, rely on the relay flag in whatever IP database you already use (Apple notes most providers label these addresses "iCloud Private Relay" or set fields such as is_relay or privacy_proxy), or ask an IP intelligence API.

Option 1: match against Apple's CSV

With 285,000 prefixes, a linear scan per request is too slow, but only about twenty distinct prefix lengths occur. Index the networks by length and each lookup becomes a few set lookups. This Python version uses only the standard library; loading the file takes about two seconds, and a lookup takes a few microseconds:

import csv
import ipaddress


def load_relay_ranges(path):
    """Index Apple's egress CSV as {(ip_version, prefix_len): {network_as_int}}."""
    index = {}
    with open(path, newline="", encoding="utf-8") as f:
        for row in csv.reader(f):
            if not row or row[0].startswith("#"):
                continue
            net = ipaddress.ip_network(row[0], strict=False)
            index.setdefault((net.version, net.prefixlen), set()).add(int(net.network_address))
    return index


def is_private_relay(ip, index):
    addr = ipaddress.ip_address(ip)
    if addr.version == 6 and addr.ipv4_mapped:
        addr = addr.ipv4_mapped
    bits = addr.max_prefixlen
    for (version, plen), nets in index.items():
        if version == addr.version and (int(addr) >> (bits - plen) << (bits - plen)) in nets:
            return True
    return False


# index = load_relay_ranges("egress-ip-ranges.csv")
# is_private_relay("172.224.226.5", index)  -> True
# is_private_relay("8.8.8.8", index)        -> False

Refresh the file on a schedule and swap the index in one assignment, so requests never see a half-built one:

# daily cron: download to a temp file, replace only on success
curl -fsS -o /var/lib/app/egress.csv.new https://mask-api.icloud.com/egress-ip-ranges.csv \
  && mv /var/lib/app/egress.csv.new /var/lib/app/egress-ip-ranges.csv

Pass the real client address, not a header value the visitor controls. Behind a proxy or CDN, configure trusted proxies first; the X-Forwarded-For spoofing guide shows how.

Option 2: use an IP check API

If you already call an IP intelligence API for VPN or proxy checks, it may identify relay traffic for you. iplogs sets is_relay: true for Private Relay (also reported in ip_info.vpn_provider and as a matched signal of type apple_private_relay). Two real responses from 2 November 2026, trimmed to the relevant fields:

{ "ip": "172.224.226.5", "verdict": "suspicious", "score": 0.55,
  "is_vpn": false, "is_proxy": false, "is_relay": true, "vpn_provider": "Apple iCloud Private Relay" }

{ "ip": "104.28.28.1",   "verdict": "suspicious", "score": 0.5,
  "is_vpn": false, "is_proxy": false, "is_relay": true, "vpn_provider": "Apple iCloud Private Relay" }

Both are recognised as Private Relay, but the scores differ, because the score also reflects the network each egress address sits on. So write the relay rule on is_relay, not on verdict or is_vpn, and test it before any VPN rule. WARP addresses also set is_relay but read vpn_detected. Otherwise relay users land in different tiers depending on which company carried their request.

Should websites block iCloud Private Relay?

No. Blocking it turns away paying Apple customers for using a feature built into their phone, and it buys little security. Apple's developer page lists what is already checked before a request reaches you:

  • Every Private Relay connection validates that the client is an iPhone, iPad or Mac and that the user has a valid iCloud+ subscription.
  • Private Relay applies its own anti-abuse and anti-fraud measures, including single-use authentication tokens and rate limiting.
  • The relay address keeps the user's region, so geo-restrictions based on country or region keep working. By default it also maps to the nearest city.

Apple's advice is to adjust IP-based fraud rules so legitimate users aren't caught, and to treat relay addresses like large carrier-grade NAT or enterprise addresses, since many users can share one. Cloudflare gives the same advice: make sure anything that indexes users by IP copes with many users coming from a handful of addresses.

There is also a technical reason a block misfires. Private Relay covers browsing in Safari, DNS queries and insecure http traffic from apps. A user's HTTPS traffic from your iOS app usually goes out over their normal connection, so the same person can show a relay address on your website and their carrier's address in your app. Treating that mismatch as fraud would flag ordinary iPhone users.

How should I handle Private Relay users instead?

Treat the relay address as a shared address rather than a risk signal, and let your other signals decide. A reasonable starting policy:

SituationWhat to do with a relay address
Browsing, content, searchAllow. Use the region for localisation if you need it.
Rate limitingKey limits on the session or account where you can, or give relay addresses a higher per-IP threshold.
Sign-upAllow. If email, device or behaviour signals look bad, add email verification, not a block.
LoginYour normal MFA rules. Don't add friction for the relay alone.
PaymentsLet your payment provider's fraud checks run; don't decline on the relay alone.
Policies that forbid VPNsDecide explicitly and write it down. If the rule exists for regional licensing, note that the relay keeps the user's region.

In code, check for the relay before your general VPN rule so it never falls into the block tier:

def decide(check):
    """check: the JSON body of POST https://iplogs.com/v1/check, or None if the call failed."""
    if check is None:
        return "allow"                                # fail open
    if check.get("is_relay"):
        return "allow"                                # Private Relay, WARP or a gateway: shared address, verified device
    verdict = check.get("verdict")
    if verdict == "vpn_detected":
        return "review"
    if verdict == "vpn_likely":
        return "verify_email"
    return "allow"

If you need a bot check, Apple offers a lighter option than a CAPTCHA. Apple says every device running iOS 16, iPadOS 16 or macOS Monterey and later supports Private Access Tokens, built on the Privacy Pass standard, which let a server confirm a request comes from a legitimate device without learning who the user is.

Can I use the list for geolocation?

Yes, that is what Apple built it for. Each row gives the country, region and city Apple assigns to that prefix, and Apple says servers can trust the region the relay address carries. If your IP database lags behind a change, the matching row in Apple's file is the more current answer for relay traffic. Keep the city as a hint: by default it is the city nearest the user, not where they are.

How do I block Private Relay on my own network?

Through DNS, not the egress ranges. The egress list describes where relay traffic comes out, which helps the websites receiving it. A school or company that must audit its own users' traffic blocks the other end. Apple's guidance is to make the resolver return "no error no answer" or NXDOMAIN for these two hostnames:

mask.icloud.com
mask-h2.icloud.com

Devices then tell the user to turn off Private Relay for that network or use another one. Apple warns against letting the lookups time out or silently dropping packets to the relay, because both cause delays on the device instead of a clear message.

Is iCloud Private Relay a VPN?

Not in the usual sense. It covers only Safari, DNS and unencrypted app traffic, keeps the user's region, and can't be used to pick a country. The Private Relay glossary entry covers the differences, and the VPN detection guide explains how relay traffic fits alongside VPN servers, Tor exits and proxies.

Questions people also ask

Where can I download the iCloud Private Relay IP address list?

Apple publishes it at https://mask-api.icloud.com/egress-ip-ranges.csv, linked from its developer page on preparing web servers for Private Relay. It is free and needs no account.

How often does the Private Relay IP list change?

Apple doesn't publish a schedule. The server marks the file cacheable for one hour, so refreshing it daily, or every few hours on busy sites, is a sensible default.

Does the list include IPv6?

Yes, and most of it is IPv6. On 27 October 2026 it held 243,361 IPv6 prefixes and 41,768 IPv4 prefixes.

Can I trust the location of a Private Relay IP?

For country and region, yes: Apple says the relay preserves the user's region. City is the closest city by default, so treat it as approximate.

Can someone fake being a Private Relay user?

Not by sending headers. The relay addresses belong to the relay operators, and Apple validates the device and iCloud+ subscription before a connection is relayed. Only the real client address, resolved through trusted proxies, should be matched against the list.

Sources

  1. Apple Developer: Prepare your network or web server for iCloud Private Relay
  2. Apple: iCloud Private Relay egress IP ranges (CSV)
  3. Apple Support: About iCloud Private Relay
  4. RFC 8805: A Format for Self-Published IP Geolocation Feeds
  5. Cloudflare blog: iCloud Private Relay, what Cloudflare customers need to know