KeyCDN IP ranges
- IPv4 ranges
- 2
- IPv6 ranges
- 0
- Last change
- 06.12.2026
- Last check
- 06.12.2026
Official source
One range per line, IPv4 first, then IPv6.
Add the lines to a server or location block. The last line blocks every other address.
Add the lines to an .htaccess file or a Directory block. Access is allowed only from the addresses in the list.
The rules allow TCP connections to ports 80 and 443 from the addresses in the list, with iptables and ip6tables.
The rules allow TCP connections to ports 80 and 443 from the addresses in the list. IPv6 ranges work when IPV6=yes is set in /etc/default/ufw.
The commands create a separate zone named keycdn, allow TCP connections to ports 80 and 443 in it from the addresses in the list, and reload the configuration.
Add the lines to /etc/csf/csf.allow and restart the firewall with csf -r. The lines allow TCP connections to ports 80 and 443, and IPv6 ranges work when the IPV6 option is enabled in csf.conf.
The rules allow TCP connections to ports 80 and 443 from the addresses in the list. The inet filter table and the input chain must already exist.
68.70.192.0/20
185.172.148.0/22Why the KeyCDN list is so short
When Origin Shield is enabled, KeyCDN edge servers reach your origin server through a small layer of servers that consolidates the requests, and the list holds only the ranges of that layer. That is why it is very short, and it suits a firewall that allows ports 80 and 443 only for these addresses, as long as Origin Shield is enabled for the zone.
The visitor IP and the X-Pull header
KeyCDN passes the visitor's address in the X-Forwarded-For header, and according to KeyCDN, the visitor's address is always the first one on the left. KeyCDN also sends the X-Pull header to the origin server. In the zone settings, you can set a secret value for it, and on the server accept only requests that arrive with that value.
set_real_ip_from 68.70.192.0/20;
set_real_ip_from 185.172.148.0/22;
real_ip_header X-Forwarded-For;
real_ip_recursive on;- This list is published by KeyCDN in an official file, and we check it every week. The service is not affiliated with ErezNet.
- On a Linux VPS, you get full root access and configure the firewall and the web server yourself with these lists.
KeyCDN IP ranges FAQ
How do I allow access to my server only through KeyCDN?
Add a rule to your server's firewall that allows ports 80 and 443 only for the addresses in the list, and block all other addresses. The ready-made formats on this page, such as nginx, iptables, UFW, and firewalld, save you the work. When the list changes, update your rules too.
How do I show the real visitor IP behind KeyCDN?
The server receives requests from the KeyCDN addresses, and the visitor's address arrives in an HTTP header. Set the addresses in the list as trusted, for example in the nginx realip module or in Apache mod_remoteip, and your logs and site show the visitor's address.
How often is the list on this page updated?
We check the official KeyCDN file once a week and update the page when something changes. The date of the last check is at the top of the page, and the recent changes are at the bottom.