Advanced User and Domain Management in DirectAdmin – Renaming Domains, Changing Usernames, Moving Domains, Merging Accounts, and Administrative Scripts

This comprehensive guide covers advanced administrative operations in DirectAdmin, including renaming domains, changing usernames, transferring domains between users, merging accounts, resolving “Domain Already Exists” errors, sending system-wide messages, modifying user packages, disabling mail_sni, and more.

Merging AccountsAdministrative Scripts

~3 min read • Updated Mar 1, 2026

1. How to Rename a Domain in DirectAdmin


To rename a domain (e.g., domain1.com → domain2.com):

  1. Go to User Level → Domain Setup → Change a Domain Name.
  2. Select the domain and enter the new name.

Important Notes:

  • Website files (public_html) and email accounts will be affected.
  • Databases are not renamed; you may need to update script configurations manually.
---

2. How to Change a Username


Run the following script as root via SSH:


cd /usr/local/directadmin/scripts
./change_username.sh olduser newuser

Security Tip: Always back up all databases (.sql) before renaming a user.

---

3. How to Move a Domain Between Users


Use the built-in script:


cd /usr/local/directadmin/scripts/
./move_domain.sh domain.com olduser newuser

Notes:

  • If newuser does not exist, create a temporary domain (e.g., fakedomain.com), move the real domain, then delete the fake one.
  • To move databases, use rename_database_with_user.sh.
---

4. How to Merge Two User Accounts


This is useful when reducing the number of accounts (e.g., for Personal license limits) or simplifying management.

Method 1: Promote User and Remove Old Account


cd /usr/local/directadmin/scripts
./user_to_reseller.sh fred
echo "fred" >> /usr/local/directadmin/data/admin/admin.list
perl -pi -e 's/^fred\n//' /usr/local/directadmin/data/admin/reseller.list
perl -pi -e 's/usertype=reseller/usertype=admin/' /usr/local/directadmin/data/users/fred/user.conf

Then log in as fred, delete the old admin account, and rename fred if needed.

Method 2: Restore Merge

If the user was deleted, rename the backup Error! Hyperlink reference not valid.


user.admin.fred.tar.gz → admin.root.admin.tar.gz

Then restore it.

Method 3: Manual Migration (Advanced)

  • Move all domains from fred to admin.
  • Move databases using rename_database_with_user.sh.
  • Copy cronjobs manually:

crontab -u fred -l
crontab -u admin -e
---

5. Fixing “Domain Already Exists” Errors


If DirectAdmin reports that a domain already exists, check the following:

  • named.conf
  • /etc/virtual/domains
  • /etc/virtual/domainowners
  • /etc/virtual/domain.com
  • .nzf files in /var/named

Also check Multi-Server Setup if “Domain Check” is enabled.

---

6. Why Some Users Do Not Appear in “Show All Users”


The cache file may be corrupted. Rebuild it:


da taskq --run="action=cache&value=showallusers"

Or delete the cache Error! Hyperlink reference not valid.


rm -f /usr/local/directadmin/data/admin/show_all_users.cache
---

7. How to Send a Message to All System Email Accounts


  1. Go to Admin Level → Show All Users → Advanced Search.
  2. Set Items per Page = All.
  3. Click Search → Select All → Send a Message.
  4. Enable All E-Mail Accounts and E-Mail Only.
---

8. Suspend/Unsuspend Users or Domains via Command Line (DA v1.595+)



/usr/local/directadmin/directadmin --suspend-user user=fred
/usr/local/directadmin/directadmin --unsuspend-user user=fred

/usr/local/directadmin/directadmin --suspend-domain domain=domain.com
/usr/local/directadmin/directadmin --unsuspend-domain domain=domain.com
---

9. Disable Reseller Suspension on Overlimit


Edit the reseller’s reseller.conf:


suspend_at_limit=OFF
---

10. Change the Package for All Users


Use this script:


OLD=custom
NEW=fancy
for i in `ls /usr/local/directadmin/data/users`; do
    if grep -q "usertype=user" /usr/local/directadmin/data/users/$i/user.conf; then
        perl -pi -e "s/package=$OLD/package=$NEW/" /usr/local/directadmin/data/users/$i/user.conf
    fi
done

Then open the new package in the panel and click Save.

---

11. Change the Package for All Users Under a Specific Reseller



CREATOR="silver"
TOPACKAGE="gold"
for u in `grep "^creator=${CREATOR}$" /usr/local/directadmin/data/users/*/user.conf | cut -d/ -f4`; do
    perl -pi -e "s/^package=.*/package=${TOPACKAGE}/" /usr/local/directadmin/data/users/$u/user.conf
done

Then open and save the gold package.

---

12. Disable mail_sni for a Specific Domain


Edit:


/usr/local/directadmin/data/users/username/domains/domain.com.conf

Add:


mail_sni=OFF

Then rewrite:


echo "action=rewrite&value=mail_sni" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d
---

13. Send Heavy Notifications (e.g., brute force alerts) to Another Email


Edit the admin’s user.conf:


[email protected],[email protected]
---

14. How to Block Specific Domains from Being Created


Copy the template Error! Hyperlink reference not valid.


/usr/local/directadmin/data/templates/forbidden_domains.list
→ /usr/local/directadmin/data/templates/custom/forbidden_domains.list

Add the domains you want to forbid.

Written & researched by Dr. Shahin Siami