INTEGRITY Cloudflare Docs

IP geolocation

IP geolocation adds the CF-IPCountry header to all requests to your origin server.

Availability

Free Pro Business Enterprise
Availability Yes Yes Yes Yes

Add IP geolocation information

The recommended procedure to enable IP geolocation information is to enable the Add visitor location headers Managed Transform. This Managed Transform adds HTTP request headers with location information for the visitor's IP address, such as city, country, continent, longitude, and latitude.

If you only want the request header for the visitor's country, you can enable IP Geolocation.

To enable IP Geolocation in the dashboard:

  1. Log in to your Cloudflare account and go to a specific domain.
  2. Go to Network.
  3. For IP Geolocation, switch the toggle to On.

To enable IP Geolocation with the API, send a PATCH request with ip_geolocation as the setting name in the URI path, and the value parameter set to "on".


Accuracy and limitations

IP geolocation is an estimate, not an exact science. There is nothing that inherently binds an IP address to a physical location or country. Because IP addresses rotate and ownership can change, the data is dynamic and may shift over time.

Here is what you can expect regarding data accuracy and updates:


Report an incorrect IP location

If you find an IP address with a location that you believe is incorrect, fill in the data correction form with the relevant IP address range(s) along with the correct information as applicable (country, state/province, city name, and ZIP code).

If the data is confirmed, Cloudflare will make the necessary changes, generally within a few business days.

If Cloudflare cannot confirm the submitted location, the correction does not result in a change.

If an end user's IP address rotates frequently, for example on mobile or CGNAT networks, the address may change again before the correction completes.