Saturday, 27 December 2025
  14 Replies
  452 Visits
1
Votes
Undo
Hello,

we are migrating from cPanel and stumbled upon this "inconvenient": by default a user can delete or change his main/default domain name in DA Domain management
interface.
We are also using WHMCS and the main domains in whmcs should match the main domain in DA panel.

How can we achieve this, or is this achievable:
1. the users can't delete or change the main/defaul domain name, but the reseller or admin should be able to do this
and
2. where allowed by the hosting plan, the users should be able to add/delete/modify only additional domains (but not the main one).

I tried different settings in directadmin.conf for "users_can_add_remove_domains" parameter but none was what i wanted.


Thanks.
1 month ago
·
#377
0
Votes
Undo
Update: I have revised the guide above based on direct feedback from DirectAdmin support.

Jonas from the support team confirmed that all_pre.sh is the correct hook to intercept this specific action (action=select), but he warned about performance implications since this hook runs on every command.

Here is the specific advice from support that led to the optimized all_pre.sh script I shared:

Hello,

As far as I can see primary hook for that action(general "command" interface) is all_pre.sh, where something like following can be used:


Bash:
#!/bin/bash

if [ "$command" == "/CMD_DOMAIN" ] && [ "$action" == "select" ] && [ "$default" == "yes" ]; then
echo "changing default domain not allowed"
exit 1
fi


Not the best hook. Customization should be as fast as possible, as it will hook into lots of other actions.

Best Regards

The final script I provided in the tutorial includes the necessary performance filter (if [ "$command" != "/CMD_DOMAIN" ]...) to address this concern and ensure the server remains fast.
1 month ago
·
#378
0
Votes
Undo

The main reason is the synchronization with WHMCS. If you change the main domain in DirectAdmin, it breaks the link with the billing system (WHMCS), causing errors with renewals and support automation. It's a limitation on the WHMCS side that requires the domain to match exactly.


I have been using both for many, many years and never had a problem. The main domain in DA rarely matches in WHMCS and I have never had a issue nor do I see why it would
1 month ago
·
#379
0
Votes
Undo

I have been using both for many, many years and never had a problem. The main domain in DA rarely matches in WHMCS and I have never had a issue nor do I see why it would


So, how do you check if a domain is no longer in use within DirectAdmin to ensure it's available for provisioning in WHMCS?
1 month ago
·
#380
0
Votes
Undo

So, how do you check if a domain is no longer in use within DirectAdmin to ensure it's available for provisioning in WHMCS?


How would you do that anyway since users can have dozens of domains but only one is listed in WHMCS? DirectAdmin is not going to let a user provision a domain that already exists anyway.

provisioning in WHMCS?


Do you mean when somebody signs up and provides a domain or are you talking about something else?

The way I use both WHMCS and DA domains are just not relevant at all. I could delete the domain in WHMCS completely and it would not make a difference in WHMCS or DirectAdmin. So perhaps you can explain a little more about your thought process.

My thought process is this:

Previously when a user signed up WHMCS would create the username on DA based on the domain name and also add that domain to their DA account. Many complained that they didn't want their username to be based on their domain so I added instructions to intead of putting their domain name to put in the username they wanted up to I think it was 8 characters with a .com as the extension. Then login to DA and delete the fake domain it created. The result was the user got the username they wanted.

Now I have WHMCS create a random username. Most seem to like that ok.

The point is the domains never needed to sync with WHMCS for anything to work properly.
  • Page :
  • 1
  • 2
There are no replies made for this post yet.
Submit Your Response
© 2026 hostsocial.io