开发者

PHP script to find domain name age [closed]

开发者 https://www.devze.com 2022-12-18 03:11 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_开发百科
Closed. This question needs to be more focused. It is not currently accepting answers.
开发者_开发百科

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 4 years ago.

Improve this question

I am trying to write a script (in PHP) that find a domain age (creation date and maybe if possible, last update and expiration date as well). I want the script to return something like: 2009,2009,2010 if creation date is 2009, update date is 2009, and expiration is 2010 (an array)

help?

(This is NOT a homework question so please provide as much help as possible)

If you need more information to explain the problem please write a comment and I will be glad to provide more information


Many domain registrars offer an API that can be queried for domain name lookups (though usually the API is offered only to resellers/affiliates). These API's are language neutral and so can be used by any programming/scripting language, including PHP.

Another option would be to do a domain lookup against a registrar's whois web interface and scrape the result. This isn't recommended though - mostregistrars implement CAPTCHAs to prevent this type of behavior.

Here's a small list of registrars that offer APIs:

  • http://opensrs.com/
    1. http://www.resellerclub.com/features/api/
    2. http://www.dynadot.com/domain/api.html
    3. https://joker.com/faq/category/39/22-dmapi.html
    4. http://www.domainpeople.com/reseller/partner-direct-api.html


You'll need to implement the WHOIS protocol (or interface with a program or library that implements that protocol). However, as far as I know, registrars are not required to return information about domain name registration and expiration dates, so you probably will not be able to reliably get this information.

What possible (legal) reason do you have for needing this?


Two approaches immediately come to mind:

  1. Using the eval function to execute the whois utility that is located on many if not most *nix systems. Then use regular expressions to find the data you are looking for.

  2. Using curl to post data to a site such as http://www.whois.net/ and then use regular expressions to grab the data that you want.

There is also this: http://hexillion.com/whois/, but that seems to require a subscription.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号