(Do you really need Domain controller?)
###NB: Zentyal webadmin doesn't shows the new records introduced throught samba-tool.!!!!
Ok, I was supposing all the services were provided by Zentyal. So, I have wasted lot of time, I'm sorry. As you are using Zentyal as Domain Controller DNS records should have being automatically configured.
However, if your DNS clients aren't joined to the domain you can configure the DNS records for these machines this way:
#Create a samba user on the webadmin and add him to the Domain Admins group (in my case 'admindc' with password 'admindc')
#Add admindc to the DnsAdmins group:
sudo samba-tool group addmembers DnsAdmins admindc
I have done this really basic script:
while IFS=" " read -r name ip
do
echo " Creating DNS record for ${name} host with ip ${ip}";
samba-tool dns add 192.168.1.43 zentyal-domain.lan ${name} A ${ip} --username=admindc --password=admindc &&
echo " A record successfully created";
done< "hosts-list.csv"
where host-list.csv is this:
windows1 192.168.2.2
windows2 192.168.2.3
windows3 192.168.2.4
windows4 192.168.2.5
windows5 192.168.2.6
windows6 192.168.2.7
Locate the script and the host-list.csv on the same folder and run the script. (Remember you have to grant -x permissions to the script)
As a result you have this:
root@curso:~# samba-tool dns query localhost zentyal-domain.lan @ ALL --user=admindc --password=admindc
(...)
Name=, Records=5, Children=0
SOA: serial=14, refresh=900, retry=600, expire=86400, minttl=3600, ns=curso.zentyal-domain.lan., email=hostmaster.zentyal-domain.lan. (flags=600000f0, serial=14, ttl=3600)
NS: curso.zentyal-domain.lan. (flags=600000f0, serial=7, ttl=900)
A: 192.168.1.43 (flags=600000f0, serial=7, ttl=259200)
A: 192.168.2.1 (flags=600000f0, serial=7, ttl=259200)
A: 192.168.3.1 (flags=600000f0, serial=7, ttl=259200)
Name=_kerberos, Records=1, Children=0
TXT: "zentyal-domain.lan" (flags=f0, serial=1, ttl=259200)
Name=_msdcs, Records=0, Children=0
Name=_sites, Records=0, Children=1
Name=_tcp, Records=0, Children=5
Name=_udp, Records=0, Children=3
Name=control, Records=1, Children=0
A: 192.168.2.250 (flags=f0, serial=7, ttl=259200)
Name=control2, Records=1, Children=0
A: 192.168.2.65 (flags=f0, serial=7, ttl=259200)
Name=curso, Records=3, Children=0
A: 192.168.1.43 (flags=f0, serial=7, ttl=259200)
A: 192.168.2.1 (flags=f0, serial=7, ttl=259200)
A: 192.168.3.1 (flags=f0, serial=7, ttl=259200)
Name=DomainDnsZones, Records=0, Children=2
Name=ForestDnsZones, Records=0, Children=2
Name=windows1, Records=1, Children=0
A: 192.168.2.2 (flags=f0, serial=9, ttl=900)
Name=windows2, Records=1, Children=0
A: 192.168.2.3 (flags=f0, serial=10, ttl=900)
Name=windows3, Records=1, Children=0
A: 192.168.2.4 (flags=f0, serial=11, ttl=900)
Name=windows4, Records=1, Children=0
A: 192.168.2.5 (flags=f0, serial=12, ttl=900)
Name=windows5, Records=1, Children=0
A: 192.168.2.6 (flags=f0, serial=13, ttl=900)
Name=windows6, Records=1, Children=0
A: 192.168.2.7 (flags=f0, serial=14, ttl=900)
Do it for the needed records and modify it for other kind of records that you'll need
Cheers!