So…virtualmin, when I create a domain, is adding as the one and only nameserver for domains. HOWEVER, the domains are set up at the registrar with and as the nameservers. How do I make virtualmin add those as nameservers instead of


Thanks Joe. I had added ns2 to the template but didn’t know where the main was coming from…

Hey Kevin,

The value is auto-detected at config check time…but it seems that it’s usually not the value people want (it ought to work, if the hostname is correctly resolving, but it usually doesn’t match what people want it to be). So pretty soon I’ll be adding a dialog during the, or a simple form within Virtualmin itself, to set this.

Anyway, it’s easy to correct:

The primary can be set in the Webmin BIND module configuration. The option is "Default master server for master zones" in the "Zone file options" section. Set it to

The secondary is a bit more “magic” as it comes from the automatic slave server configuration (e.g. it’s all automatically configured for you, if you follow the steps in[a href=“”>the Automatic DNS Slaves Quickstart</a>…just fill in in the “Name for NS record” field when creating it).

If you aren’t using automatic slave setup (I’d recommend you use it, as it’ll save you a lot of time), then you’ll have to add the new NS record to your Server Template(s) in the BIND DNS Domain section in the field labeled “BIND DNS records for new domains”. You’d add:

${DOM} 38400 IN NS

And choose "Add above to automatically generated records".

Save it.