I\'m not looking for a service that does this. I\'m just curious as to how geolocation works.
As I understand it, IP subnets are assigned to the providers upstream of your service providers - each IP range is therefore flagged as being within the country of origin of that provider, so each IP within that range is assumed to be within that country.
This is not foolproof - we previously had satellite broadband provided to us (in the UK) by a Belgian provider. Each time we googled anything, we'd be offered to see only pages within Belgium.