How to set up your own nameservers
Run ns1 and ns2 on your own domain: the A records, the glue records at your registrar, the panel setting, a check, and a secondary that keeps DNS answering.
Published
With nameservers of your own, your customers point their domains at ns1.yourdomain.com and
ns2.yourdomain.com, and from then on every DNS record their websites and email need is made and kept up to date by
the server. Nobody has to copy records by hand. This guide
explains the steps and why each one matters.
You need a server with Hfog Panel installed with DNS (not with --no-dns) and access to the registrar of your
server's own domain. Customers who'd rather keep their DNS elsewhere still can: their Control Panel's DNS setup
page lists the records to add.
Give the names an address
The nameservers are names under your domain, so they need A records like any other name. Where yourdomain.com's
DNS is run, point ns1.yourdomain.com and ns2.yourdomain.com at the server's public IP address. Running
hfog-agent dns-setup on the server lists them with its real address.
Register the glue records
There is a catch: the nameservers sit inside the domain they serve, so nobody could look them up without already
knowing where they are. The registrar breaks the circle with glue records, sometimes called child nameservers,
host records or "register nameservers". At the registrar of yourdomain.com, create ns1.yourdomain.com and
ns2.yourdomain.com, each with the server's IP address.
Tell the panel
In Server Admin › Settings › General settings, under DNS & network, check Nameserver 1, Nameserver 2
and the Server IP address, then save. New DNS zones list these nameservers, and customers see them on their
DNS setup and Domains pages, with a Copy button. To use other names from the start, give --ns1 and
--ns2 when you install.
See Settings.
Check them
Run hfog-agent dns-setup --check on the server. It looks every record up in public DNS and marks what is still
missing. Glue records can take a few hours to appear, so a missing one right after you add it is normal. The
DNS group of Server Admin › Server › Server health keeps checking afterwards.
Add a second machine
Two names on one server still go down together. A secondary nameserver copies every zone from this server and keeps
answering when it is down, ideally from another data centre. If the second machine runs Hfog Panel and is added under
Accounts › Servers, click Make secondary next to it in Server Admin › Hosting › DNS cluster. Any BIND
9.18 or newer server works too, with the configuration the same screen shows. When it shows In sync, point
ns2.yourdomain.com, its A record and its glue record, at the secondary.
See DNS cluster.
Tell your customers
Customers now set ns1.yourdomain.com and ns2.yourdomain.com at their own registrar, and their DNS setup page
checks their domain live. Resellers can show nameserver names of their own to their customers.
Every click, in order, is in Set up your own nameservers. Share Point a domain bought elsewhere with your customers, and see DNS setup for the server's own records.
Try it on your own server
Install Hfog Panel and try every feature free for 30 days.