// Tutorial //

How To Create Vanity or Branded Nameservers with DigitalOcean Cloud Servers

Published on July 10, 2013
Default avatar
By Pablo Carranza
Developer and author at DigitalOcean.
How To Create Vanity or Branded Nameservers with DigitalOcean Cloud Servers

Introduction

Of particular interest to hosting providers or resellers, having branded or vanity nameservers provides a more professional look to clients. It eliminates the need of asking your clients to point their domains to another company's nameservers. This tutorial will outline two approaches to creating custom nameservers: (i) Vanity and (ii) Branded.

Types

Vanity nameservers allow you to use your own domain name, without having to setup complicated zone files; you can do this using DigitalOcean's nameservers and DNS Manager. This is accomplished by mapping your custom nameservers to DigitalOcean's IPs.

Branded Nameservers require a little more configuration, but allow you to exert complete control over DNS for your domain. The added control, however, carries with it the burden of having to self-manage your DNS. You'll need to deploy at least two VPS, with specialized software such as BIND, PowerDNS or NSD (for "name server daemon"). Wikipedia publishes a nice comparison of DNS server software.

Naming

You can use any naming scheme you want. If you're unsure, the most common schemes are ns1.yourdomain.com or a.ns.yourdomain.com.

Prerequisites

Ingredients for Both Vanity & Branded Nameservers:

1. Registered domain name from an established registrar, e.g. GoDaddy; NameCheap; 1&1; NetworkSolutions; Register.com etc. (at this time, DigitalOcean does not offer domain registration services.)

2. Glue Records: Ascertain your domain registrar's procedure for creating glue records. Different registrar's refer to glue records by different names, such as GoDaddy whom refers to them as host names. Other providers may refer to the process as "registering a nameserver" or "creating a host record." Glue records tell the rest of the world where to find your nameservers and are needed to prevent circular references. Circular references exist where the nameservers for a domain can't be resolved without resolving the domain they're responsible for. If you are not able to determine how to create Glue Records at your particular domain registrar (that is, how to "register a nameserver or host name"), then you need to contact your registrar directly and let them know that you need to register a nameserver.

For Vanity Nameservers Only

DigitalOcean's current IP addresses for its nameservers (which can be obtained by clicking on the respective hyperlinks, below; or, via nslookup; dig; or ping commands):

ns1.digitalocean.com

ns2.digitalocean.com

ns3.digitalocean.com

Additional Requirements if You'd Like to Maximize Control Over Your Domain's DNS, with Branded Nameservers:

Create or identify at least two VPS that you control that will act as Primary and Secondary Nameservers.

NOTE: It's technically possible to have only one VPS act as both the Primary and Secondary Nameserver. This approach, however, is not recommended because it sacrifices the safety that redundancy provides (i.e., fault tolerance). Keep in mind, however, that there's no hard limit of only two nameservers for your domain. You're only limited by the number of nameservers that your domain registrar allows you to register.

Deploy a DNS Server on your Primary and Secondary Nameservers. See How to Setup DNS Slave Auto Configuration Using Virtualmin/Webmin on Ubuntu; How to Install the BIND DNS Server on CentOS 6; or How To Install PowerDNS on CentOS 6.3 x64

The Quick & Easy Recipe: Vanity Nameservers:

1. First, login to your DigitalOcean Control Panel and add your domain name to the DigitalOcean DNS Manager.

2. Then, create A Records for your vanity nameservers and point them to DigitalOcean's IPs for ns1.digitalocean.com; ns2.digitalocean.com; ns3.digitalocean.com.

To accomplish this, create a new host A-Record with ns1.yourdomain.com. (do NOT forget to end the hostname with a period) in the hostname field. The IP address to use for ns1.yourdomain.com. is the IP address you discovered for ns1.digitalocean.com (above). Repeat these steps for ns2.yourdomain.com. and ns3.yourdomain.com.

For example:

(Do not forget the trailing dots)

A   ns1.yourdomain.com.     [IP address for ns1.digitalocean.com]
A   ns2.yourdomain.com.     [IP address for ns2.digitalocean.com]
A   ns3.yourdomain.com.     [IP address for ns3.digitalocean.com]

3. Next, you need to replace DigitalOcean's NS Records with each of your vanity nameservers in the DigitalOcean DNS Manager.

(Do not forget the trailing dots)

NS      ns1.yourdomain.com.
NS      ns2.yourdomain.com.
NS      ns3.yourdomain.com.

4. This next step will vary, depending on your domain name's registrar: Login to your domain name registrar's control panel and register the IPs of your nameservers by creating Glue Records. In another words, associate (or map) DigitalOcean's nameserver IPs with your vanity nameservers' hostnames.

<p>With GoDaddy, for example, simply login to your Domain Name Control Panel
and look for the area where you can list Host Names. There, click on Manage
=> Add Hostname and enter NS1 for the Hostname and ns1.digitalocean.com's IP
address; click Add Hostname again and enter NS2 for the Hostname and
ns2.digitalocean.com's IP Address. Click Add Hostname yet a third time and add
NS3 for the Hostname and ns3.digitalocean.com's IP Address.</p>

5. Almost done! Skip down to the DNS Testing section.

Recipe for Maximum Control, with Branded Nameservers:

The simplest way to configure DNS is to have someone else do it. For that reason, you should consider using DigitalOcean's DNS Manager.

If you really want to manage your domain's DNS yourself, however, you next need to deploy a DNS server such as BIND. A complete zone-file configuration is beyond the scope of this tutorial. However, you need to ensure that you apply the same principals described above:

1. Create both A & NS Records for ns1.yourdomain.com. and ns2.yourdomain.com. (with BIND, especially, do not forget the trailing periods).

2. Ultimately, your zone file will contain the following entries:

ns1.yourdomain.com. IN  A   1.2.3.4
<pre>ns2.yourdomain.com. IN  A   1.2.3.5</pre>
<pre>yourdomain.com.     IN  NS  ns1.yourdomain.com.</pre>
<pre>yourdomain.com.     IN  NS  ns2.yourdomain.com.</pre>

3. Remember, the IP addresses for your ns1 and ns2 A Records (and for your Glue Records) come from you--in that you have to set up at least two VPS to run your name servers.

4. Login to your domain name registrar's control panel and create Glue Records for as many nameservers you wish to deploy. Just make sure that you are using the IP addresses of servers under your control (and not the addresses of DigitalOcean's nameservers).

DNS Testing

To make sure you configured everything correctly, you can run the Check Domain Configuration tool. Keep in mind, however, that, depending on your registrar, nameserver changes can take up to 72 hours to properly propagate throughout the Internet.

Article Submitted by: Pablo Carranza

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in our Questions & Answers section, find tutorials and tools that will help you grow as a developer and scale your project or business, and subscribe to topics of interest.

Sign up
About the authors
Default avatar
Developer and author at DigitalOcean.

Still looking for an answer?

Was this helpful?
10 Comments

@kamaln7:

Is this feature still working?

Any possibility that this article could be updated with DO’s new DNS manager?

It isn’t possible to put in the trailing dots in the A records and also the creation of a NS record without the field hostname doesn’t seem possible to me.

Any response would be great!

Thanks…

@Kamal Nasser: vestcp team suggested the following and it works great;

If you want to manage DNS in vesta then you don’t need DO DNS manager at all. IP address for child name servers should be your DO instance IP address.

Domain registrar (i.e goddady or someone else )

  1. Create ns1/ns2 record and point them to instance ip address
  2. Change name servers to ns1.site.com and ns2.site.com

Vesta control panel

  1. Add domain site.com
  2. Edit dns domain site.com -> select child-ns template -> Save
  3. Set ns1.site.com and ns2.site.com as default name servers

Cool, thanks for the reply. Updating manually is fine, I was just worried it might happen out of the blue without me noticing. As long as an email warning gets sent out first or something.

“DigitalOcean’s current IP addresses for its nameservers […]”

How likely is it these could change? If they do, would all domains pointing at ns1.mydomain.com stop working? I’d have to update with the new IP addresses, right? Is there some system in place that would prevent downtime?

When I add my domain name to the DigitalOcean DNS Manager I must also change the Nameservers in the domain registrar?

How to create the glue servers on AWS, in Route 53?

this post should be updated as the DO dashboard design and interface has changed.

I just wonder at the step 3 (vanity) it says " 3. Next, you need to replace DigitalOcean’s NS Records with each of your vanity nameservers in the DigitalOcean DNS Manager."

what should i enter in the field “WILL DIRECT TO” in my DO dashboard? I have tried both directing it to my own or DO ns server.

both tried this and no luck:

Type Hostname Value TTL (seconds) NS ns3.mydomain.com.tr Copy directs to ns3.mydomain.com.tr Copy 86400 Copy More NS ns2.mydomain.com.tr Copy directs to ns2.mydomain.com.tr Copy 86400 Copy More NS ns1.mydomain.com.tr Copy directs to ns1.mydomain.com.tr Copy 86400 Copy More A ns2.mydomain.com.tr Copy directs to 173.245.59.41 Copy 3600 Copy More A ns3.mydomain.com.tr Copy directs to 198.41.222.173 Copy 3600 Copy More A ns1.mydomain.com.tr Copy directs to 173.245.58.51 Copy 3600 Copy More

Hi i have a problem i make all the tutorial and i cant get working

I try to make Vanity nameserver

i Have 2 domains registred on namesilo.com domain1.com domain2.com

the domain1.com it in DO i create a glue records for domain1.com

i create A records for the 3 ips ofDO A ns1.domain1.com. 173.245.58.51 A ns2.domain1.com. 173.245.59.41 A ns3.domain1.com. 206.81.11.78

Change the NS Record from ns1.digitalocean.com. to ns1.domain1.com. ns2 ns3

Now i go to namesilo, and chege the nameserver for domain2

in the domain2 i put

ns1.domain1.com ns2.domain1.com ns3.domain1.com

Now i make the dns test

for domain1 its perfect.

For domain2 say

No name servers found for domain2.com. Received answer from A search was performed starting with the root servers, but no NS records were found for this domain. Try again as the name servers for this domain may have been busy and didn’t respond in time. If this error persists, there may be a problem with your name servers.

The domain2.com i need to add in some place in Digital Ocean

to be able to work I must create a virtual server in virtualmin or the DNS test should work the same for more than the virtual server is not created in virtualmin

Thanks

When testing with http://www.webdnstools.com/dnstools/domain_check I get the following message:

Your SOA record lists ns1.digitalocean.com as the Primary nameserver. This server is not listed as a valid nameserver at the parent servers.

Would it be possible to change the SOA record to point to my vanity nameservers, or is it the only chance to add ns1.digitalocean.com as one of my domain’s DNS records?

I’m little late on the topic but I have a specific question. I have hosted my DNS with CloudFlare and it seems, DO’s name servers are hosted with CF. So my issue is, that I cannot create A Record at CF as it throws an error - You cannot use CF IP…

Do I really need to add any other record if I want to continue using CF DNS for my own website but use my name servers (ns1.mydomain.com, ns2…, ns…3) for my customers. Means, my customers would use my name servers to point to their servers.