PHP script to find the age of a domain name

I am trying to write a script (in PHP) that finds the age of the domain (creation date and, if possible, the latest update and expiration date). I want the script to return something like: 2009,2009,2010 if the creation date is 2009, the update date is 2009, and the expiration is 2010 (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, write a comment and I will be happy to provide additional information.

+4
source share
3 answers

Many domain registrars offer an API that can be requested to search for domain names (although usually the API is provided only to resellers / branches). These APIs are language neutral and therefore can be used by any programming / scripting language, including PHP.

Another option is to do a domain search on the whois logger web interface and clear the result. This is not recommended, but - mostregistrars implements CAPTCHA to prevent this type of behavior.

Here is a short list of registrars offering an API:

+4
source

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

What possible (legal) reason do you need for this?

0
source

Two approaches come at once:

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

  • Use curl to send data to a site, such as http://www.whois.net/ , and then use regular expressions to capture the data you want.

There is also the following: http://hexillion.com/whois/ , but this requires a subscription.

0
source

Source: https://habr.com/ru/post/1299601/


All Articles