DNS and Nameservers in DirectAdmin – Complete, Practical, and Professional Guide

DNS is the backbone of the internet, responsible for translating domain names into IP addresses. DirectAdmin allows you to create private nameservers (ns1/ns2), manage DNS zones, configure DNS clustering, use external DNS, and troubleshoot common issues. This guide provides a complete, clear, and practical explanation of DNS concepts and their implementation in DirectAdmin.

Nameservers in DirectAdmin

~3 min read • Updated Mar 1, 2026

1. What Is DNS and How Does It Work? (Simple Explanation)


DNS (Domain Name System) converts a domain name like domain.com into an IP address like 1.2.3.4. Without DNS, browsers wouldn’t know where websites are located.

The 3 main components of DNS:

  1. Parent Nameservers The 13 global root servers. They only store: “Which nameservers does this domain use?”
  2. Registrar The company where you purchased your domain. You tell the registrar which nameservers your domain should use (e.g., ns1.domain.com).
  3. Your own Nameservers These run on your DirectAdmin server and provide the final DNS answers.

How a DNS lookup actually works:

  1. User → ISP DNS
  2. ISP → Parent Nameservers (asks: “What are the NS for domain.com?”)
  3. Parent → returns ns1.domain.com and ns2.domain.com
  4. ISP → asks ns1/ns2: “What is the IP of www.domain.com?”
  5. Your nameserver → returns the IP
  6. ISP caches the answer for the TTL (usually 4 hours)
---

2. Creating Private Nameservers (ns1/ns2.domain.com)


Step 1: Create A records in DirectAdmin

Go to:


User Level → DNS Management → domain.com

Add two A records:


ns1    A    1.2.3.4
ns2    A    5.6.7.8

If you only have one IP, use the same IP for both.

---

Step 2: Register Glue Records at the Registrar

In the “Host Names” or “Glue Records” section:


ns1.domain.com → 1.2.3.4
ns2.domain.com → 5.6.7.8
---

Step 3: Set the Nameservers for the domain


ns1.domain.com
ns2.domain.com
---

Step 4: Wait for DNS propagation

Propagation takes 4–48 hours.

Check status:


https://intodns.com
---

3. Adding a Third Nameserver (ns3)


DirectAdmin shows only two NS fields, but you can manually add ns3.

Step 1: Customize dns_ns.conf


mkdir -p /usr/local/directadmin/data/templates/custom
cd /usr/local/directadmin/data/templates/custom
cp ../dns_ns.conf .

Add this line at the end:


ns3.host.com.=|DOMAIN|.
---

Step 2: Rewrite all DNS zones


echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d400
---

Step 3: Remove the extra line from the original template

To avoid duplication in future updates.

---

4. Using External DNS (Disabling named on DirectAdmin)


If you prefer to use Cloudflare, Route53, or any external DNS provider:

Step 1: Disable named


systemctl stop named
systemctl disable named

Step 2: Create a “placebo” named service

So DirectAdmin thinks named exists:


nano /etc/systemd/system/named.service

Content:


[Unit]
Description=Named Placebo
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/echo -n ''

Reload systemd:


systemctl daemon-reload

Step 3: Disable named in DirectAdmin


echo "named=OFF" >> /usr/local/directadmin/data/admin/services.status
---

5. DNS Clustering (Multi-Server Setup)


To create redundant DNS (recommended for production):

Step 1: Prepare two DirectAdmin servers

Server A and Server B

Step 2: Configure MultiServer Setup

On Server A:


Admin Level → MultiServer Setup

Add Server B’s IP (Zone Transfer = ON)

Repeat the same on Server B.

---

Step 3: Sync all DNS zones


echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
---

Important notes:

  • Domain Check = ON → only checks for duplicates
  • Zone Transfer = ON → full DNS sync
  • Domain Check = OFF → force sync
---

6. Final Tips & Common Troubleshooting


  • Domain already exists → zone exists in named.conf or cluster server
  • Missing Glue Record → ns1/ns2 do not resolve
  • Propagation delay → always wait 4–48 hours
  • Hide BIND version:

options { version "secret"; }

Then restart:


systemctl restart named

Written & researched by Dr. Shahin Siami