Antoni Massó Mola said:
There are a number of website who have this service and decect the country
of my IP.
There must be a way to achieve this. I'll search to see if there is a
commercial version.
There are a number of commercial versions which are unable to tell you the
actual country the user is in. This is because IP addresses cannot reliably
be used to tell you the country.
There is nothing in the standards or RFCs which says that there must be a
correspondence between ranges of IP addresses and countries. Any of these
services are simply using a fluke of the registration process - that when
someone registers for a range of IP addresses, an address is recorded, and
that the address contains a country. But this has absolutely nothing to do
with how those IP addresses are distributed, or to which country.
Sorry, but if you need something reliable (perhaps for legal reasons), then
this isn't it.