Hello,
Assuming you want to keep those subdomains for the primary domain names associated with the cPanel accounts, you could develop a custom script that manually removes those DNS records through the manipulation of the corresponding zone file in the /var/named/ directory. Then, configure that custom script to run as a post hook every time a new subdomain is added:
Guide to Standardized Hooks - Software Development Kit - cPanel Documentation
You can find the corresponding API function for a hook by enabling
"Debug mode is on. The system displays information about every stage for every hookable event, even if no hooks exist for that stage." under the "Development" tab in "WHM >> Tweak Settings". Then, perform the specific action you want to hook into via cPanel or WHM, and watch the output in /
usr/local/cpanel/logs/error_log.
For example, the following cPanel API 1 function is utilized when adding an Alias in cPanel:
Cpanel::Api1::Park::park
You can find documentation on hooks with cPanel functions at:
Guide to Standardized Hooks - Cpanel Functions - Software Development Kit - cPanel Documentation
Thank you.