Can we Block State wise

Hello Can we Block State wise like we have country wise block
As i only want my website to be accessed from a single state of a single country .rest i want to block all .

I presume you mean US state, right?

However regardless of the country, this is actually practically very difficult to impossible. IP information is rarely accurate enough to implement this feature in a reliable fashion. As far as Cloudflare is concerned, they do not offer that at that point either.

The terminology here can get confusing, so some definitions to start.

Cloudflare use the MaxMind GeoIP2 database. All the codes are from the ISO 3166 standard. There are multiple levels in the database, Country, Subdivision 1(US State, GB County, Andorra Parish etc. ), and Subdivision 2 (City).

Currently Cloudflare only expose the Country in firewall rules and in the CF-IPCountry header.

You also have access to the City in Workers. You can get a list of City to State mappings from

I’m aware that Subdivision 1 will be made available in Firewall rules shortly. I hope it makes it to Workers shortly thereafter, but I have not been told if it will be made available there at all.

The problem is this data can be, and usually is, wildly inaccurate. On US state levels it might still be accurate it comes to local ISPs but the moment you enter the territory of nationwide providers you might find yourself across the country. Even more so on mobile connections.

I don’t doubt that at all. I’ve given testimony in parliament about the difficulties in using GeoIP data as a means to determine where a user is. For some ISPs the data is absolute garbage, but others provide reliable data to the DB providers like MaxMind, Neustar/Quova and Digital Element. Combined with other sources like credit card shipping address data and the databases are getting better.

The accuracy is generally usable for larger territories, and users have become somewhat accustomed to certain inaccuracies.

I definitely would not use anything below subdivision 1 for any blocking purpose. City is usable to show something like weather in your city, provided there is an option to alter the automatically chosen location.

I second that (even though even the first subdivision typically is not very reliable). And the former part was the exact point I was trying to make, geo restrictions based on anything more detailed than the country typically dont work well.

Hello , I here by as you to Block Indian States and not US states
If i want to run a particular website in a Single State or couple of states than i should be able to block from rest of the country .

This topic was automatically closed after 30 days. New replies are no longer allowed.