# Adding custom nameservers on PNLCS

> **Writer's brief**
> - **Audience:** a reseller who wants customers to see `ns1.theirbrand.com` instead of the provider's nameservers.
> - **Promise:** "Branded nameservers make your hosting look like your own, from the first DNS lookup."
> - **Keywords:** private nameservers, custom nameservers reseller, child nameservers, glue records, branded DNS.
> - **Call to action:** run a DNS check on your new nameservers.
> - **Explain simply:** nameservers are the "address book" a domain points to; custom ones are the same address book under your name.

**Custom (private) nameservers** are your own names, such as
`ns1.yourbrand.com` and `ns2.yourbrand.com`, for the same DNS servers your
hosting already uses. Customers point their domains at your names, and the
DNS answers come from the same servers as before.

Setting them up has two parts: **create the nameservers on the internet**
(at the registrar of your brand domain), then **tell PNLCS to use them**.

**You need:** a domain you own (e.g. `yourbrand.com`) and the IP addresses of
the nameservers your hosting uses. See [Before you start](00-before-you-start.md#branded-nameservers).

## Part 1: create the nameservers

### 1. Find the IP addresses

Ask your hosting provider (Truehost support) for the IP addresses to use for
private nameservers. You can also look up the IPs of the nameservers you use
today, for example with an online DNS lookup tool or on a computer:

```
dig +short ns1.cloudoon.com
```

Use the IPs your provider confirms. Your custom nameservers only work if
they point to DNS servers that hold your customers' domains.

### 2. Register child nameservers (glue records)

At the registrar where **your brand domain** is registered, find **Private
nameservers**, **Child nameservers** or **Register nameservers**, and create:

| Nameserver | IP address |
|---|---|
| `ns1.yourbrand.com` | first IP from step 1 |
| `ns2.yourbrand.com` | second IP from step 1 |

If your brand domain is itself managed in your PNLCS panel, you can do this
from the client area: open the domain → **Own nameservers (glue)**.

> 📸 **IMAGE 1: Registering child nameservers**
> - **Show:** a registrar's "register nameservers" form with ns1 and ns2.
> - **Highlight:** the nameserver and IP fields.
> - **Blur:** the account name.
> - **File:** `images/custom-nameservers/01-child-nameservers.png`
> - **Alt text:** "Registering ns1 and ns2 child nameservers with their IP addresses"

### 3. Add matching A records

In the DNS zone of `yourbrand.com`, add A records `ns1` and `ns2` pointing to
the same IPs. Lookups then agree everywhere.

### 4. Wait, then check

Changes can take a few hours to spread. Check with an online DNS lookup, or:

```
dig +short ns1.yourbrand.com
```

It should return the IP you set.

## Part 2: tell PNLCS to use them

PNLCS uses nameservers in three places. Set your names in each:

| Where | What it's used for |
|---|---|
| **Setup → Domain Registrars → Truehost → Default Nameservers 1–5** | **New domains** registered or transferred through Truehost, when the customer gives no nameservers. This is the important one |
| **Setup → Servers → edit your server → Nameservers** | What hosting customers are told in their **welcome email**, and where **Set Up on My Hosting** points a domain |
| **Setup → General Settings → Domains → Default Nameservers** | Used by some other registrar modules. Fill it in too, to keep everything consistent |

1. Open each screen, enter `ns1.yourbrand.com`, `ns2.yourbrand.com` (and more if you have them).
2. Save.

> 📸 **IMAGE 2: Default nameservers on the Truehost registrar**
> - **Show:** Setup → Domain Registrars → Truehost, the Default Nameservers fields with branded names.
> - **Highlight:** Default Nameservers 1 and 2.
> - **Blur:** API Username and API Key.
> - **File:** `images/custom-nameservers/02-registrar-defaults.png`
> - **Alt text:** "Default nameservers set to ns1 and ns2 of the reseller's own domain"

> 📸 **IMAGE 3: Server nameservers**
> - **Show:** Setup → Servers → edit server, the Nameservers fields.
> - **Blur:** IP address, credentials.
> - **File:** `images/custom-nameservers/03-server-nameservers.png`
> - **Alt text:** "Hosting server settings with branded nameservers"

> ⚠️ **Do Part 1 first.** If PNLCS hands out nameservers that don't exist yet,
> new domains won't resolve and new customers' websites won't load.

## Existing domains

Changing the defaults only affects **new** domains. Existing ones keep their
nameservers until they're changed:

- **Customers** change them in the client area: open the domain → **Nameservers**.
- **You** can change them from the domain's page in the admin area
  (**Clients → Domains**).

## Test it

1. Register a test domain (or use **Set Up on My Hosting** on a test account).
2. Open the domain in the admin area: the nameservers shown should be yours.
3. Check the domain's website loads.

## Troubleshooting

| Problem | Fix |
|---|---|
| The registrar refuses `ns1.yourbrand.com` | The child nameserver isn't registered yet (Part 1, step 2), or hasn't spread. Wait and try again |
| Domains on the new nameservers don't load | The IPs don't point to the DNS servers that hold the zones. Confirm the IPs with your provider |
| New domains still get the old nameservers | Check **Default Nameservers** on the Truehost registrar, and that the customer didn't enter nameservers on the order |
