How to get the Country according to a certain IP? [duplicate]

There are two approaches: using an Internet service and using some kind of local list (perhaps wrapped in a library). What you want will depend on what you are building.

For services:

For lists:

Leave a Comment