Tuesday April 16, 2024

Domain Expiration Notify Script

Adding to CRON
These scripts are intended to be run periodically on a server. The first script should be run every 15-30 minutes, as to not flood WHOIS servers or cause problems with retrieving WHOIS information. The second script should be run once a day, to send out notifications of domain expirations.

To add to CRON add the following lines to /etc/crontab or root's crontab:
*/30 * * * * root lynx -dump http://www.yourdomain.com/whois.php 1> /dev/null 2> /dev/null
00 1 * * * root lynx -dump http://www.yourdomain.com/domainnotify.php 1> /dev/null 2> /dev/null

*Be sure to replace www.yourdomain.com with the appropriate http location of your script and the script names with whatever names you saved the script code to.

You could also run these scripts using php's cgi executable, if you have it installed on your system (likely in /usr/bin/php).

Overview
These scripts are meant to give you some ideas on how to solve the problems associated with domain renewals. There are some third-party sites available that will gladly take your money to notify you of domain status changes or domain expirations, but if you're tight on cash or don't have a large number of domains to monitor, these scripts should do just the trick.

page1 page2 page3 page4


Comments:
no error but expiry date is not coming in database
Posted 03/19/11 4:26AM by leaftemp
no error all done, but no expiry date is coming in database i think this is because of wrong date format as on domain table default 0000-00-00 is different from the date format in whois server.

So please help me to correct my code.
Re: Expiration
Posted 09/21/09 6:17PM by AceBHound
Sounds like the $expiration string isn't getting built correctly. Before the SQL call to UPDATE the domains table, try echo'ing out the $expiration variable and see if it contains YEAR-MONTH-DAY (like 2009-12-31) or if it looks like "--". It's possible the WHOIS server you're using could be using a slightly different format and you'll need to adjust the code that parses out data from the WHOIS call.
Expiration
Posted 09/15/09 4:52PM by Anonymous Techdoser
Great script, everything seems to work well except the expiration field in my database does not update.
Thanks!
Posted 08/14/09 12:21PM by thomascim
Hi Wayne, thanks very much for this useful code.

One suggestion is maybe adding an extra field to the database table for the extension.

This way you can also check domain extensions that have more or less than 3 characters like co.uk or .de, .eu, etc.

Thanks again,

Thomas

problem with exec()
Posted 02/06/09 4:28PM by jschrader
I have installed the code, and am getting an error about the exec(), to be specific:


Warning: exec() has been disabled for security reasons in /home/a5704353/public_html/notify.php on line 38

Free Web Hosting

PHP Error Message

Warning: Invalid argument supplied for foreach() in /home/a5704353/public_html/notify.php on line 39


what is going on?
how to get the registrar
Posted 06/03/07 3:40PM by rocko
Hi, I see your script. It is really good and help me a lot.
But Im trying to use a registrar field. I use different string functions but I couldn't.
There are any way to use the registrar field?
Thanks in advance.
How to set cron tab
Posted 10/16/06 12:01AM by creativetest
How to set cron tab