Well you would first need to find the ranges that the US and Canada use.
Not to mention that those ranges can be portable and new ranges are being added pretty consistently.
Simpli Networks, LLC :: http://www.simplinetworks.com :: Proudly 100% Owned.
Providing Affordable Managed Cloud/VPS Servers & Server Management Solutions.
We offer REAL 24x7x365 in-house support - proudly serving our customers since 2005!
Want to learn more? Give us a call - +1 (844) 4SIMPLI or email sales[@]simplinetworks.com today!
May be, you can use an external service likehttp://www.dnsstuff.com/tools/city.ch?ip=188.8.131.52 , that tells you the location of traffic. You need to parse the location info and then allow/disallow your traffic.
In my opinion, using geo-ip snooping is ok to roughly target your ads
But using it to block traffic would be tricky for a few reasons:
- Every request would need to be processed. I have yet to see this done at the webserver or OS level, and doing it via PHP/ASP/etc could be expensive
- As lots of people have pointed out, blocking traffic by country is dangerous becuase it's difficult to be 100% sure of incoming IP locations (in a timely fasion) and also your target audience might not be strictly grouped into countries