English 中文(简体)
How to know the original country of a website?
原标题:
  • 时间:2010-09-25 15:11:41
  •  标签:
  • php
  • alexa

I want to know the original country of a website. I noticed that Alexa website can often detect the original country of websites. For example, Alexa can detect that the original country of stackoverflow.com website is USA and so on. How Alexa do this? and how i can do this? Thank You..

最佳回答

You can always read the country of any website from Alexa s Data from XML

core data

http://data.alexa.com/data?cli=10&url=http://www.flipkart.com

full data

http://data.alexa.com/data?cli=10&dat=snbamz&url=http://www.flipkart.com

It will be more reliable and easier than any other self developed approach

问题回答

The other answers are fine, but bear in mind that many DNS registrations are protected by anonymization services, and that many sites are also hosted by providers in countries other than the one where the site s owner is.

example.com could be physically hosted on an American ISP s server, DNS provided by a Canadian company, and the site s owning company could be in Lesotho. You just can t tell these days.

In whois protocol you have one information "country" witch you must use it.

You could get this information out of the IP of a domain. You would need an IP-to-country database to look up that country.

Try this http://www.ip2country.net/

Most likely checks the DNS data for given domain

http://en.wikipedia.org/wiki/Whois

You can do a WHOIS lookup as mentioned in other answers to get the information about the website that were stored by the registrar and filled in by the user. But you rely on an existing database of user-entered information and not actual technical data.

You can use a an IP geo-localisation service to get the location based on the IP. This may not always work for all IPs. You could also do this for all the hops you go through, which you can list by doing a traceroute (with tracert on Windows or traceroute on *NIX) and see where your request is travelling to.





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签