I would like to know how to create your own name servers and manage them on your own ubuntu server(so they will no longer be configured on the domain registrar panel). Like, for example, I would take CWP panel(centos web panel, and I believe other panels like cPanels are the same):

  1. I would register my domain and create my own name servers(NS1-2.mydomain.com) pointing to my server's IP.
  2. I would go on my admin panel's host->DNS Functions->Edit Nameservers IPs and set them to ns1.mydomain.com and ns2.mydomain.com.
  3. I would create a new account with mydomain.com and then starting configuring the new account with domain linked in the user's panel(like FTP, adding or changing DNS functions).
  4. I would add some other domain(with another account)[myex.com] with nameservers set for ns1-2.mydomain.com, managing all the dns options/ftp from my user's panel

How would I do all those things manually? I mean, how can I create custom nameservers so I would point others domain to my main domain and then managing them from my server manually? (I would use apache2)

  • 1
    I don't understand why you would do (2). If you set up BIND or something like that to serve as the authoritative name server for your domain, that doesn't mean it has to be used as the DNS servers for any particular server. What do you mean by (3)? Email account? What does apache2 have to do with DNS? This is very confusing.
    – muru
    Dec 4, 2023 at 23:33

2 Answers 2


DNS nameservers serve two purposes:

  • to publish information about domains
  • to cache, forward, and relay domain requests from local clients to remote dns servers

You may be confusing these two purposes.

Neither if these purposes is to "register" a domain. Domain registration is done with a registrar entity, not a local domain name server. You can publish any domain name you want in your local DNS server; however, nobody but you will see that unless an external registrar points to it. And typically, you have to buy (rent?) top level domains from the registrars. Some registrars even run DNS for you so you don't have to.

As to web panels with apache2, that's just a fancy wrapper around things that build config files and databases that the DNS servers actually use. If you pick the right registrar, they might have that, and you will have to consult their documentation on how to use it, that's not a standardized thing that we can describe here.


@user10489 is right, I was confusing some things when I first written this question, however I found more documentation about what I was searching. Yes, I was asking about how to make a DNS server and host multiple domains on a single host. I find all I needed in these tutorials:

Not the answer you're looking for? Browse other questions tagged .