The domain sync task is responsible for ensuring the Next Due Date, Expiry Date and Status are up to date on all Pending Transfer, Pending Registration and Active status domains where a valid registrar module is set on the domain itself.
How it works
The domain sync task works by using the domain synchronization functions built into each registrar module (if the module supports Domain Sync Script in the documentation for the module) to check 50 domains per run from the oldest to newest in your WHMCS installation. Pending Transfer, Pending Registration and Active domains are handled separately, so it can do 50 of each during each run.
Active domains will have their Expiry Date corrected to match the registrar if different. If the dates already match it will report "In Sync".
Pending Registration domains will have their Expiry Date corrected to match the registrar if different, and Status set to Active once the registration is complete. If the dates already match it will report "In Sync".
Pending Transfer domains will usually report an error until the transfer process is complete at which point the status will automatically be changed to Active, the Domain Transfer Completed email template sent and the Expiry Date obtained from the registrar.
When used with the eNom module, the script can also send the Domain Transfer Failed email template if the transfer process fails.
For example: if you are using eNom and have 150 Active and Pending Registration domains and 20 in Pending Transfer status, the script will check the 20 Pending Transfer status domains as needed during each run, along with 50 of the Active and Pending Registration status domains, starting over once it reaches the newest domain.
Depending on the configuration under Configuration () > System Settings > Automation Settings or, prior to WHMCS 8.0, Setup > Automation Settings, the domain sync task will adjust at least the Expiry Date and Status, with the possibility of the Next Due Date if "Sync Next Due Date" is configured. Once the domain sync cron job has completed, an e-mail will be sent to any admins whose administrator role has "System Emails" enabled. If "Domain Sync Notify Only" is enabled, no changes will be made and the e-mail will simply list the changes that would have been made.
Setting it up
To set up the domain sync task, please configure the following setting under Configuration () > System Settings > Automation Settings or, prior to WHMCS 8.0, Setup > Automation Settings first:
- Domain Sync Enabled - Tick this checkbox to enable the domain date and status synchronisation function.
- Sync Next Due Date - Choose whether to sync the Next Due Date to the Expiry Date, and how many days in advance of it (if desired).
- Domain Sync Notify Only - If enabled, the domain sync script won't make any changes - it will only notify admins of the changes it would have made. Useful for debugging.
- Domain Expiry Sync Frequency - A value of 0 will check the domain expiration dates every 4 hours. Use this setting to specify a different frequency. The lowest frequency setting of 1 will check every hour.
- Pending Transfer Sync Frequency - A value of 0 will check the domains in Pending Transfer status every 4 hours. Use this setting to specify a different frequency. The lowest frequency setting of 1 will check every hour.
In version 7.6 and above, the Domain Synchronisation Task is handled by the main cron job. No further setup steps are required. For 7.5 and earlier, additional setup is required:
In version 7.5 and earlier some of these settings are located under Configuration () > System Settings > General Settings > Domains or, prior to WHMCS 8.0, Setup > General Settings > Domains. An additional set up step is required to create a cron job to trigger the /crons/domainsync.php file:
Sample Cron Command
0 3 */2 * * php -q /home/username/crons/domainsync.php
The above example will run every 2 days at 3am.
Sync not supported by module
This indicates that the registrar module set on the domain in question does not support the domain sync functionality and no changes will be made to it as a result. This is most common with third party/custom modules and will need to be fixed by the developer to resolve this.
Curl error - could not connect to host
This is most commonly caused by not whitelisting the server's IP at your domain registrar (for example: eNom or ResellerClub) for API access. You will need to contact them and provide the IP from Help > License Information in your admin area for whitelisting to resolve this.