Need help for Server Templates

I would like to create personal DNS template to apply them at the virtual server creation.

So i create a server template and i want to set the field “BIND DNS records for new domains” but i don’t know how to fill it. Do you have exemples of how to do that ?

Many thanks.

It’s exactly what i need.

Many thanks :slight_smile:

Hey Mathieu,

Any valid BIND DNS record can be added to or can replace the Virtualmin generated ones. The defaults look soemthing like this:

$ttl 38400 @ IN SOA ( 1119502166 10800 3600 604800 38400 ) IN A IN A ftp IN A mail IN A @ IN MX 5 mail IN A IN A IN NS ns0 IN NS ns1 IN TXT "v=spf1 a mx ?all"

So, you could add another nameserver like so:

${DOM} IN NS ns0.mydomain.tld

Where ${DOM} is a variable that gets substituted during domain creation–there are several variables you can use in many places throughout server templates. They are documented here:

The only thing about this field that is unique to Virtualmin is the variable substitution. Everything else is just standard BIND record syntax, and any documentation you find for your version of BIND will be useful. If you have complex needs, there is no better book than the O’Reilly book named “DNS and BIND” by Cricket Liu and Paul Albitz. It’s probably the finest tech book I’ve ever read, and I’ve read a lot of tech books (and written one). :wink:

And, of course, you have the collected wisdom of all 2500 or so users here at (or, at least, the couple hundred or so that regularly read the forums). Ask about any specific questions you have and we’ll probably be able to guide you.