That is what this is about. There's a utility called dnscmd.exe that you can use with a batch file to setup domains programmatically. Details on doing it is at those links.
example:
dnscmd PRIMARY /zoneadd contoso.COM /primary /file contoso.COM.dns
//sets up the overall zone contoso.COM on the primary name server
dnscmd SECONDARY /zoneadd contoso.COM /secondary /file contoso.COM.dns
//sets up the zone on the secondary
dnscmd PRIMARY /recordadd contoso.COM @ A 1.1.1.1
//sets up the record on the primary server for contoso.COM pointing to the IP 10.1.1.1
dnscmd PRIMARY /recordadd contoso.COM www CNAME contoso.COM
//sets up a CNAME record for
WWW.contoso.com to point to the same IP as
// contoso.COM
batch file for adding a new site: Code:
@SET PRIMARYNS=dns.contoso.com
@SET SECONDARYNS=dns1.contoso.com
@SET IP=1.1.1.1
@SET LOC=c:\web
@SET FTPSITE=ftp_computername
@SET ANONACCT=IUSR_computername
@SET IIS_ASPNET_ACCT=networkservice
@if "%1" == "?" goto usage
@if "%1" == "/?" goto usage
@if "%1" == "" goto errormissingvariable
@if "%2" == "" goto errormissingvariable
@if "%3" == "" goto errormissingvariable
@if "%4" == "" goto errormissingvariable
@set path=%path%;%SYSTEMDRIVE%\inetpub\adminscripts;%SystemDrive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\50\bin
:dns
dnscmd %PRIMARYNS% /zoneadd %2%3 /primary /file %2%3.dns
dnscmd %SECONDARYNS% /zoneadd %2%3 /secondary /file %2%3.dns
dnscmd %PRIMARYNS% /recordadd %2%3 @ NS %SECONDARYNS%
dnscmd %PRIMARYNS% /recordadd %2%3 @ A %IP%
dnscmd %PRIMARYNS% /recordadd %2%3 www CNAME %2%3
:dir
mkdir %LOC%\%1
mkdir %LOC%\%1\%2
copy temp.htm %LOC%\%1\%2\temp.htm
:web
iisweb /create %LOC%\%1\%2 "%2%3" /d www.%2%3
cscript //nologo translate.js "%2%3" > siteid.txt
for /f %%I in (siteid.txt) do SET SITEID=%%I
Adsutil set w3svc/%SITEID%/serverbindings ":80:WWW.%2%3" ":80:%2%3"
Del siteid.txt
:iffp
if "%4"=="y" goto fpse
goto skipfp
:fpse
owsadm -o install -p 80 –m www.%2%3 -t msiis -u %1
:skipfp
:ftp
Iisftpdr /create "%FTPSITE%" %1 %LOC%\%1
cscript //nologo translateftp.js "%FTPSITE%" > ftpsiteid.txt
for /f %%I in (ftpsiteid.txt) do SET FTPSITEID=%%I
adsutil.vbs set msftpsvc/%FTPSITEID%/root/%1/accesswrite "true"
del ftpsiteid.txt
:acls
cacls %LOC%\%1 /t /e /g %1:c %IIS_ASPNET_ACCT %:r <y.txt
@goto end
:errormissingvariable
@echo You are missing a variable.
@goto usage
:usage
@echo Creates a domain on the LOCAL server.
@echo var1=username, var2=domain (without extension!), var3=extension, var4=y (for FrontPage 2002 Server Extensions, n for none.)
@echo EXAMPLE myusername mydomain .com y
@goto end
:end