gTLD lifecycle
(source: ICANN)
As you are probably aware of, a typical gTLD or nTLD domain runs through multiple phases after it’s expiration date. The last of which is the pendingDelete status which typically lasts 5 days.
If you are serious about getting a domain, it is these very 5 days on which you should become active. (at latest).
Since I still have a reseller account with 1blu business GmbH, I’m going to illustrate howto setup a cronjob for their domain robot. The steps required to set this up, will varry quite a bit.
Code sample
|
|
What does it do?
- it requires an external dependency called GuzzleHttp which needs to be installed with
composer
prior to running - In the outer if we check if there is no lock file present and only then continue
- we then do a DomainAvailability check on the domain and depending on the status (0 = Available) continue
- If the status != 0 we give a message and stop execution
- else we perform the Registration attempt
- in the end we close the outer if with a message that a lockfile exists.
Howto install it
You will need SSH access to your webserver in order to run these steps
- create a empty directory to store the script
- install composer:
curl -sS https://getcomposer.org/installer | php
- install Guzzle in your folder:
composer require guzzlehttp/guzzle:^7.0
- copy&paste the above script with the
$EDITOR
of your choice in a file namedregister.php
- Create a cronjob with
crontab -e
- Include the following 2 lines:
MAILTO=your.mail@provider.tld
* * * * * php -f /root/folder/register.php
Why Availability check?
You can decide that for your self. For me each registration attempt comes with an email from the 1blu domain robot which I guess my account manager also gets. In order to not fall under API abuse, I rather perform this extra step.
Optimizations
Currently the script send an email per minute which can be a bit problematic if they end up in your phone notifications. To reduce the noise, you could use fwrite(STDERR, "message");
to write the output of the registration attempt and for the cron redirect STDOUT
to /dev/zero
.