Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 719579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:39:32+00:00 2026-05-14T05:39:32+00:00

What are the location detecting techniques for IP addresses? I know to look at

  • 0

What are the location detecting techniques for IP addresses?
I know to look at the
$_SERVER['HTTP_ACCEPT_LANGUAGE'] (not accurate but mostly useful to detect location, for example if an IP range’s users set French to their browser then it means that this range) belongs to France
and
gethostbyaddr($_SERVER['REMOTE_ADDR']) (to look country code top-level domain)
then may be to whois gethostbyaddr($_SERVER['REMOTE_ADDR'])
sometimes:
$HTTP_USER_AGENT (Firefox’s user agent string has language code, not accurate but mostly can be used to detect the location)

Also I know how to get the time zone but it does not work in the new browsers.
Moreover there is css issue that detects visitor’s history, it can be used to see what google and wikipedia pages he/she has visited (google.co.uk, google.com.tr)

But what about cities?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:39:33+00:00Added an answer on May 14, 2026 at 5:39 am

    You can’t do this without a database that maps IP addresses to cities/countries/providers. There are commercial offerings such as ip2location that you could use. AFAIK there is no free alternative though, as maintaining such a IP database is quite a lot of work. Free alternative: GeoIP2

    Update:
    There are several things that allow you to create such a db, if you invest enough time:

    1. Use the databases provided by regional and local registries to find an IP’s owner.
    2. Many ISPs use a naming schema that allows you to locate the user. Sometimes you can
      even read the city name in plain text if you do a reverse-DNS lookup. Sometimes it is
      more cryptic. For example I currently have p5dcf6c4a.dip.t-dialin.net , and I have no
      idea that the naming scheme is..
    3. Use a traceroute. If you can’t identify the location of a user, you can still find out
      the location of its uplink
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Location detecting techniques for IP addresses For our website it's important to
Using Google's example code for detecting a user's location, I setup a basic page
Chrome seems to be very accurate in detecting my location. How does it do
window.location.href does not work to save the current web page url as a bookmark.
I've checked various related questions already posted about detecting mobile devices for websites, but
location.hash seems to be utterly broken in Safari 4: It can be set initially,
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
The location data is essentially in a tree structure. So when you ask someone
Assembly.Location gives a plain path to the assembly. Unfortunately this is empty when running
A location table record has two address id's - mailing and business addressID that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.