So I want to have my own nameservers, like ns1.mydomain.com and ns2 and I have the following things:

  • my domain (with godaddy)
  • a VPS with 1 IP
  • a DNS shared service with access to cPanel and ns1.hostingcompany.com and ns2.hostingcompany.com

So, it's possible to use their shared DNS service and get my own nameservers?


Use your VPS as primary for your DNS, then use a DNS replication service as secondary. This is simple and gives best reliability.

For your VPS: install and configure a DNS software. BIND is popular. djbdns is good.

As DNS replication (aka secondary DNS) service, there are several for free:

Find more services at this list of secondary DNS services page.

  • Ok, let's suppose that I want my nameservers appear as ns.mydomain.com, the only way to do this is setting up my own DNS server? or I can get my ns.mydomain.com using a external DNS service too? – Danny Jun 10 '12 at 8:19
  • You can get personalized names on external DNS services also. This requirement is usually called "Vanity DNS" and is usually paid. – michele Jun 25 '12 at 21:51

Depending on the VPS hosting company, you can install and run your own nameserver on your VPS and have your nameserver like ns.mydomain.com. If you use the shared DNS, you will have to use the ns1.hostingcompany.com nameservers.

  • But I only have 1 IP, can I repeat the address for the second nameserver? – Danny Jun 9 '12 at 0:08
  • No, but you can give two names to the same IP. For a usual setup, I would stick with the shared DNS, mainly because a DNS server will "steal" your VPS resources without adding much. – laurent Jun 9 '12 at 0:19
  • obs: by names, I mean A records of course – laurent Jun 9 '12 at 0:24

Your VPS hosting company may act as your secondary DNS servers, but for a small domain it may be just as well to use your domain registrar. This can make lookups a little faster for those servers that need to look up you address.


There's a reason why at least 2 nameservers are required. Don't put both name servers on the same machine.

If you want to run your own DNS servers, set up another cheap VPS somewhere. It doesn't require a lot of resources. However, you'll need to learn about BIND.


create your both name server under 1 ip. Install bind on your VPS server. Configure Bind server and use your own Name server under your VPS server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.