
If you sell domains next to your hosting, a WHMCS registrar module is what makes it hands-free. A customer pays for a domain, and the module registers it with your registrar automatically. Renewals, transfers and nameserver changes work the same way. Without a module, someone has to log in to the registrar and do each job by hand. This guide explains how registrar modules work, what they can do and when it makes sense to build your own.
What a WHMCS Registrar Module Does
A registrar module, also called a domain module, is a connector between WHMCS and a domain registrar. WHMCS asks, the module translates the request into the registrar’s own system, and the registrar’s answer comes back to WHMCS. According to the official WHMCS registrar documentation, a module lets WHMCS register, manage and renew domains.
The three core jobs run when a customer pays for a domain order or renewal:
- Registration of a new domain.
- Transfer of a domain in from another registrar.
- Renewal of an existing domain.
It works much like a provisioning module, which creates hosting accounts, except that the thing being created is a domain. Both react to a paid invoice, which ties billing to automation.
What Else a Registrar Module Can Manage
Beyond the three core jobs, a module can support a long list of extra features. Each one is optional, so a module only needs to include what its registrar offers:
- Availability checks and name suggestions in the order form.
- Nameserver and WHOIS contact management.
- DNS host records and email forwarding.
- EPP code retrieval for transfers out.
- Registrar lock and ID protection.
- Private (child) nameservers.
- Expiry and status synchronization, and transfer monitoring.
- Domain deletion requests.
How a Domain Order Flows Through WHMCS
Here’s what happens from checkout to a live domain:
- The customer adds a domain to their order and pays the invoice.
- WHMCS calls the module’s registration function with the domain details.
- The module sends the request to the registrar’s API.
- The module returns success, or an error message if something went wrong.
- WHMCS marks the domain active, or shows the error to staff so they can fix it.
Staff see the error message in the admin area, while clients never do, so you can write helpful technical errors without worrying about what customers read.

Inside a Registrar Module
Registrar modules live in /modules/registrars/, each in a folder named after the module. The official guide says a module name should be a single word, using only lowercase letters and numbers, starting with a letter, and not matching any existing module. Every function in the file starts with that name, for example mydomains_RegisterDomain.
No function is strictly required. A module should only define the functions its registrar supports. Here are the most common ones:
| Function | What it does |
|---|---|
RegisterDomain | Registers a new domain |
TransferDomain | Starts a transfer in |
RenewDomain | Renews an existing domain |
GetNameservers / SaveNameservers | Reads and updates nameservers |
GetContactDetails / SaveContactDetails | Reads and updates WHOIS contacts |
GetRegistrarLock / SaveRegistrarLock | Reads and toggles the transfer lock |
GetEPPCode | Returns the code needed to transfer out |
Sync | Updates expiry date and status from the registry |
TransferSync | Updates the status of transfers in progress |
GetTldPricing | Imports TLD prices from the registrar |
On WHMCS 7.6 and later, GetDomainInformation is preferred over the older nameserver and lock functions, because it returns the details together. The function index lists every available function.

A Simplified Registration Function
This sketch shows the basic shape of a registration function. A real module would call the registrar’s API where the comment is:
<?php
if (!defined('WHMCS')) {
die('This file cannot be accessed directly');
}
// Settings shown when you activate the registrar in WHMCS.
function mydomains_getConfigArray()
{
return [
'APIKey' => [
'Type' => 'password',
'Size' => '40',
'Description' => 'Your registrar API key',
],
];
}
// Called when a paid domain registration needs to happen.
function mydomains_RegisterDomain($params)
{
$domain = $params['sld'] . '.' . $params['tld'];
$years = $params['regperiod'];
try {
// Call the registrar's API here to register $domain for $years.
return ['success' => true];
} catch (Exception $e) {
// Errors go in the 'error' key and are shown to admins only.
return ['error' => $e->getMessage()];
}
}
Functions assume success unless they return an error message, which is why the error key matters so much. WHMCS also publishes a sample registrar module on GitHub that’s a good starting point for any new build.
Domain Synchronization: Keeping WHMCS Accurate
Domains change outside WHMCS all the time. A customer might renew at the registrar directly, or a transfer might finish without anyone telling WHMCS. The Sync and TransferSync functions fix this. They run on the WHMCS daily cron and pull expiry dates and statuses from the registry, so your records stay correct and you don’t bill customers for domains they’ve already renewed. That’s one more reason to keep your WHMCS automation cron running properly.
Choosing a Registrar: Existing Module or Custom?
Many registrars already offer a WHMCS module, and WHMCS itself ships with several. Check these first, because a ready-made, maintained module is cheaper than building one. A custom module makes sense in a few situations:
- Your registrar has an API but no WHMCS module.
- The existing module is missing a feature you need, such as DNS records, ID protection or TLD price sync.
- The existing module is abandoned and no longer works with current WHMCS releases.
- You sell for a regional registry with special rules, such as extra contact verification.
Before you commit, confirm the registrar has a documented API and a testing sandbox. A module is only as good as the API behind it. Test registrations, renewals and failed requests in the sandbox before any real domain is involved.
Tips for a Reliable Domain Setup
- Keep registrar credits topped up if your registrar charges from a balance. An empty balance makes registrations fail.
- Watch the admin alerts. Failed registrations show an error for staff, so check them daily.
- Whitelist your server IP at the registrar if their API requires it, and update it if your server moves.
- Use the TLD price sync where available, so your prices follow your costs.
- Protect your API keys. Store them in the module settings, never in code. Our WHMCS security checklist covers more ways to protect your install.
Frequently Asked Questions
What is a WHMCS registrar module?
It’s a connector that lets WHMCS register, renew and manage domains through a registrar’s system automatically, instead of someone doing it by hand.
Where do registrar modules go?
In the /modules/registrars/ folder of your WHMCS install, in a folder named after the module.
Do I need a registrar module to sell domains?
No, but without one you’ll register and renew every domain manually. A module makes domains fully automatic and keeps expiry dates in sync.
Can you build a registrar module for my registrar?
If your registrar has a documented API, yes. We build against the official WHMCS module APIs. Our addon module guide explains how custom modules fit together.
Need a Custom WHMCS Registrar Module?
We build custom WHMCS modules, including registrar, provisioning and payment modules, with full source code. See all of our WHMCS addons and modules, or tell us which registrar you need connected.