in reply to Community ads

... How does it work and who provides such services?

Maybe you should have a look at Geo::IP or IP::Country for details.