Your request isn't clear if you actually need full subdomains defined
If you looking to create: test.domain.com and then have
www.test.domain.com, ftp.test.domain.com, blah.test.domain.com and fully delegate DNS management to a separate zone?
You don't actually need a separate zone file in many cases as you can define hosts with any number of parts in normal DNS, you're just creating A records, infact if you only have one server/IP you can have a wildcard A record that allows anything.domain.com com to point at the same server and then sort it out with apache vhosts.
As for creating stuff automatically, well depending on your DNS provider you should certainly be able to create A records (etc.) programatically through either directly manipulating zone files if you're self hosting or APIs for many common DNS providers.
Clarify what you're actually trying to do and you'll get better answers.