How to determine location based on IP

Kannan Nadar
Tera Guru

Hi Team,

I would like to determine a user's location based on IP Address without using any third party tool or API.

Please let me know if there is a way.

Thanks,

Kannan

11 REPLIES 11

adilrathore
ServiceNow Employee
ServiceNow Employee

A private IP Address cannot fetch location information unless the internal network team, possibly the DNS team can fetch you the information on which IP subnets are assigned to which location/building/floor in an organization.


Brad Tilton
ServiceNow Employee
ServiceNow Employee

ServiceNow won't be able to grab location information for you based on an IP. You would need to integrate with an external service for this. What exactly are you trying to use it for?


Hello Brad,



Thank you for your reply.



I am trying to get the user's local timezone. I almost achieved this using Auto-Time zone detection shared in "ServiceNow Share ", but consider Australia/Melbourne and Australia/Sydney, they both have the same time zone offset. Due to which users in Melbourne are getting their time zone set as Australia/Sydney. This might not be a great impact since the time will be converted properly but the user profile will show Australia/Sydney as their time zone whereas the user is located in Australia/Melbourne.



Thanks,


Kannan


In order to be exact and if the machines have access to internet you can try html5 geolocation:



javascript - Get city name using geolocation - Stack Overflow