Hi all,
This solution was not documented anywhere, i may not be the only one that loves a clean zone file (without yucky cPanel records that are no longer needed).
If anyone wants to get rid of the "old" cPanel records once you've migrated over:
#!/bin/sh
for user in `cat /usr/local/directadmin/data/users/*/users.list`; do {
for DOMAIN_TO_USE in `grep ": ${user}$" /etc/virtual/domainowners | cut -d: -f1`; do {
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=cpanel" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=cpcalendars" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=cpcontacts" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=webdisk" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=whm" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=cpanel" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=cpcalendars" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=cpcontacts" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=webdisk" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=whm" >> /usr/local/directadmin/data/task.queue
echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=TXT&name=_cpanel-dcv-test-record" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq
}
done
}
done
And cPanel also does add the webmail subdomain, you could remove that one too but it might be nice to keep that one if you have a webmail subdomain enabled on DirectAdmin.
@DirectAdmin Support @smtalk any ideas to make this better, or maybe that we could even check subdomains that have these records?
Happy days!
??