To run branded nameservers such as ns1.example.com and ns2.example.com from a Virtualmin VPS, you must configure three matching layers: child-host (glue) records at your registrar, A and NS records in the Virtualmin DNS zone, and the nameserver defaults used by Virtualmin for new domains. Registering the hostnames at the registrar is mandatory because Virtualmin cannot create or edit registrar glue. Once all three layers use the same names and public IP addresses, verify delegation with whois and host, then allow a few hours—up to 48 hours according to Virtualmin’s guidance—for changes to propagate.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What custom nameservers are you configuring?
A custom nameserver arrangement gives your hosted domains branded authoritative DNS endpoints instead of exposing a registrar’s default names. In this example, the names are ns1.example.com and ns2.example.com. The labels are only examples; replace example.com and the IP addresses with your own values.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
Four records or settings have to agree:
| Layer | What it contains | Where you change it | Why it matters |
|---|---|---|---|
| Child-host registration (glue) | ns1.example.com and ns2.example.com mapped to public IP addresses |
Your domain registrar | Lets resolvers find the IP address of a nameserver whose name is inside the domain it serves |
| Domain delegation | The domain’s delegated NS set, normally ns1.example.com and ns2.example.com |
Your registrar | Tells the DNS system which servers are authoritative for the domain |
| Zone records | NS records plus A records for the two nameserver hostnames | Virtualmin’s DNS Records page | Provides the authoritative answer and resolves each nameserver name to an address |
| Virtualmin template | Primary and additional nameserver hostnames | Webmin’s Server Templates settings | Controls the NS set written for newly created hosted domains |
Virtualmin’s own wording is the key rule: NS records on the Virtualmin server should align with the glue records. A mismatch can produce intermittent failures or SERVFAIL, even when one lookup appears to work.
Requirements and planning before you touch DNS
Use a supported, clean VPS installation
Start with a fresh operating system supported by your Virtualmin edition and installation method. Virtualmin’s installation material recommends a supported OS and a domain whose DNS records can point to the server’s public IP. The official download and installation references are Virtualmin’s downloading and installing guide and the automated installation documentation.
#1 Best Overall
Give the VPS a proper hostname before installing or configuring services. The hostname should be a fully qualified name that resolves appropriately while you perform the setup. Keep a record of the VPS public IP address or addresses; you will enter those exact values at the registrar and in Virtualmin.
Have registrar access and control of the domain
You need permission to create registered hosts or child nameservers at the registrar, not merely permission to edit ordinary DNS records. Registrars use different labels—such as Register nameserver, Child host, Host records or Glue records—but the function is the same. You must also be able to change the domain’s delegated nameserver list.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Decide what ns1 and ns2 represent
Two names do not automatically mean two independent DNS systems. If both hostnames resolve to the same VPS, a VPS outage takes both nameservers offline. That arrangement can be suitable for a small deployment or a learning environment, but it is not an independent failure domain. If resilience is a requirement, plan a separate secondary DNS server and use Virtualmin’s secondary-DNS workflow rather than adding a second hostname on the same machine.
Step 1: Prepare the VPS, hostname and primary domain
- Install Virtualmin on the supported operating system. Follow the edition-specific prerequisites and installation procedure in the official documentation. Do not start delegation until the server has a stable public IP and the Virtualmin installation is complete.
- Set the server hostname. Use a proper fully qualified hostname and confirm that the VPS provider and operating system report the same name. A hostname typo makes later DNS checks difficult to interpret.
- Choose the primary domain. In the example, that is
example.com. Ensure you can edit its registrar account and that its DNS can eventually point at the VPS. - Record the intended addresses. Write down the public IP for
ns1.example.comand the public IP forns2.example.com. They may be separate addresses or, in a basic single-VPS setup, addresses that terminate on the same machine; whichever values you choose must be used consistently everywhere.
Step 2: Register ns1 and ns2 as child nameservers at the registrar
This is the glue-record step, and it cannot be completed inside Virtualmin. Virtualmin’s DNS troubleshooting documentation explicitly notes that the registrar controls glue records. Log in to the registrar, open the domain’s host or child-nameserver management screen, and create both entries.
- Create a host named
ns1.example.comand assign its intended public IP address. - Create a host named
ns2.example.comand assign its intended public IP address. - Save the host records and check the spelling of every label. A missing dot, an extra space or a different domain suffix creates a different hostname.
- In the registrar’s nameserver or delegation screen, select
ns1.example.comandns2.example.comas the nameservers forexample.com.
Some registrars require you to save the child hosts first and return to a separate delegation page; others present both actions together. Follow the labels in your registrar’s interface, but do not substitute ordinary A-record editing for child-host registration. The two operations solve different parts of the delegation process.
Step 3: Add matching A records in Virtualmin
After registering the hosts, create the corresponding records in the authoritative zone on the VPS. In Virtualmin, open the primary domain and use DNS Settings → DNS Records.
Rank #2
- Choose the option to add an A record.
- Enter the hostname for
ns1.example.comexactly as it appears in the registrar host entry, and enter the same public IP assigned to that host. - Add a second A record for
ns2.example.comwith the second registrar-assigned IP. - Save the zone and review the resulting records for spelling and address errors.
The registrar’s glue IP and each Virtualmin A record must agree. If the registrar says that ns1.example.com is at one address while the zone served by Virtualmin says it is at another, different resolvers can follow different paths and return an error. The same rule applies to ns2.example.com.
Check the zone’s NS records as well
The zone should advertise the same nameserver names that you delegated at the registrar. If the registrar delegates ns1.example.com and ns2.example.com but the zone still publishes an old provider name, the delegation and the authoritative answer disagree. Review the NS records in the DNS Records page and correct the names there if necessary.
Step 4: Set Virtualmin’s nameserver template for new domains
Virtualmin uses a server template to decide which nameserver set is written when you create additional virtual servers. Configure the default template so future domains receive your branded names.
- Open System Settings → Server Templates.
- Edit Default Settings.
- Open the DNS domain section.
- Set Primary DNS server hostname to
ns1.example.com. - In Additional manually configured nameservers, enter
ns2.example.com. - Save the template.
This template controls the NS set written for newly created hosted domains. It does not register child hosts at the registrar; that remains a registrar-side task. When you add a new domain later, confirm that its generated NS records contain the names you expect before changing that domain’s delegation.
Free tools Windows power users keep installed
One-click scans. No signup required.
Step 5: Verify all three DNS layers
Do not rely on a single browser lookup. Check registrar data, delegated NS records and address resolution separately. Virtualmin’s DNS troubleshooting guide documents the following commands; run them from a shell with the host and whois utilities installed.
Inspect registrar-side information
Run:
whois example.com
Look for the domain’s current nameserver delegation and, where the registrar exposes it, the registered host or child-nameserver information. The exact output format depends on the registry and registrar, so treat the command as a way to confirm the names in use rather than as a fixed parser target.
Rank #3
Ask for the delegated NS set
Run:
host -t NS example.com
The answer should list the intended nameserver hostnames, such as ns1.example.com and ns2.example.com. If old names appear, the delegation has not been changed, the change has not propagated to the resolver you queried, or the registrar saved a different set than intended.
Resolve the domain normally
Run:
host example.com
This confirms that the domain is returning address data through the normal resolution path. It does not by itself prove that both custom nameservers are healthy, so perform the direct test next.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Query through the nameserver directly
Run:
host example.com ns1.example.com
Repeat with ns2.example.com if needed. A successful response demonstrates that the named server can answer for the domain. Compare the returned address and authority information with the records you entered in Virtualmin.
Propagation: what to expect after a correct change
Virtualmin states that DNS changes may take from a few hours up to 48 hours to propagate. That is vendor guidance, not a universal guarantee: different recursive resolvers may refresh at different times. During that window, one network may show the new delegation while another still shows the old nameservers.
Keep the old service available if you are migrating an established domain and can do so safely. Test from more than one network or resolver, but do not keep changing records simply because one lookup is stale. First establish whether the authoritative data is correct; then allow caches to expire.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsWhy custom nameservers return SERVFAIL
SERVFAIL means the resolver could not obtain a usable authoritative answer. With a new Virtualmin nameserver setup, the cause is usually a disagreement between registrar glue, delegation and the zone served by BIND.
Rank #4
Glue IP and Virtualmin A record do not match
Symptom: host -t NS example.com lists the right names, but queries through those names fail or work only from some locations.
Fix: Compare the IP assigned to each child host at the registrar with the A record for the same hostname in Virtualmin. Correct whichever side is wrong so that ns1 and ns2 resolve to the registrar-registered addresses. Re-run the direct host tests after the correction.
The delegated NS set and the zone NS set differ
Symptom: The registrar delegates one pair, while the zone’s NS records contain an old name, a typo or only one of the pair.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchFix: Make the delegated names and the zone’s NS records identical. Then verify that the corresponding A records exist for every nameserver name. Virtualmin’s documentation summarizes the requirement as alignment between NS records and glue records.
The registrar change has not propagated
Symptom: One resolver still returns the previous nameserver set shortly after you saved the change.
Fix: Confirm the registrar account shows the intended delegation and wait through the propagation period. Virtualmin’s estimate is a few hours to up to 48 hours. A stale answer during that interval is not proof that the final configuration is wrong.
Best Value
The template was changed, but a new domain still has different NS records
Symptom: The primary domain works, but a newly created virtual server advertises the registrar’s defaults or an old nameserver.
Fix: Reopen System Settings → Server Templates → Default Settings → DNS domain. Confirm that Primary DNS server hostname is ns1.example.com and that ns2.example.com appears under Additional manually configured nameservers. The template affects how new hosted domains are generated; it does not perform registrar delegation for them.
Both nameserver names point to one failed VPS
Symptom: The records are internally consistent, but DNS stops answering whenever the VPS or its network connection is unavailable.
Fix: Add an independent secondary DNS server. Renaming the same VPS or creating another hostname on it does not create a separate failure domain.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Adding an independent secondary DNS server
For resilience beyond one VPS, use Virtualmin’s documented secondary-DNS workflow. The relevant instructions are in How to Configure Secondary DNS.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →- Open Webmin’s Servers → BIND DNS Server → Cluster Secondary Servers workflow.
- Configure the remote secondary server and enable creation of secondary zones.
- In the BIND module configuration on the primary server, set the primary server’s external IP address as required by the workflow.
- Create or synchronize the secondary zones, then verify that the secondary answers for the same domains.
- Update the domain’s NS set only after both the primary and secondary arrangements are correctly configured.
The exact transfer settings depend on the secondary server and your security policy, so use the options shown by the BIND module rather than copying settings from an unrelated provider. The important architectural difference is that the secondary must run on another server or service; two names on one VPS remain one failure domain.
Single VPS versus independent secondary
| Decision factor | Both branded names on one Virtualmin VPS | Virtualmin primary plus independent secondary |
|---|---|---|
| Failure independence | None if both names terminate on the same VPS | Improved because the secondary is outside the primary VPS failure domain |
| Setup complexity | Registrar glue, Virtualmin records and template configuration | Those steps plus BIND cluster and secondary-zone configuration |
| Branded nameserver control | Direct control of the local ns1/ns2 records |
Still requires matching branded delegation and correctly configured secondary data |
| Cost | Not stated; depends on your VPS and registrar | Not stated; depends on the independent secondary service or server |
A repeatable checklist for each hosted domain
Use this sequence whenever you create a domain that should use the custom nameservers:
- Confirm that
ns1.example.comandns2.example.comremain registered child hosts at the registrar. - Confirm that their registrar IP addresses still match the A records in the authoritative Virtualmin zone.
- Check that the domain’s zone contains NS records for both branded names.
- Check the Virtualmin server template before creating the domain so the generated NS set is correct.
- Create the virtual server and inspect its DNS Records page.
- Delegate the new domain at its registrar to the same nameserver set.
- Run
host -t NS your-new-domain.example,host your-new-domain.exampleand a direct query through each nameserver. - Allow for propagation before treating a stale response as a configuration failure.
Changing an IP address later
An IP change must be coordinated across the registrar and Virtualmin. Update the child-host address at the registrar and the matching A record in the Virtualmin zone, then verify the delegated NS set and direct queries. Leaving one side unchanged recreates the glue-to-A mismatch that causes resolution failures. If you operate an independent secondary, update the primary and secondary configuration according to the BIND cluster workflow before relying on the new address.
Final verification standard
The setup is complete when the registrar shows both registered hosts, the domain delegation lists the same two names, the Virtualmin zone publishes matching NS and A records, and direct host queries receive authoritative answers. Keep the template configured for future domains, and use an independent secondary when availability must survive a failure of the Virtualmin VPS.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




