marcel
By:
marcel

What nameservers to use / how to set up multiple domains within one VPS (virtualmin)

December 13, 2013 7.2k views
Hello, I succesfully installed virtualmin. I have set up one domain as virtual server , this works. I see my HTML uploaded to that domain. However, I now try to set up multiple domains in virtualmin. So I created a sub-server (thats how virtualmin calls it), being my domain. I tried to use own nameservers for this domain, which I have setup in my master domain. But this does not work. Why does this not work, and any info/tutorials on how to set up multiple domains in virtualmin, and what NS settings to use? To summarize my question: I have 2 domainnames registered by an external domain registar. I want both domains running on a single VPS. How can I do this? Thanks a lot in advance! Been bugging with this the whole day.
12 Answers
"I tried to use own nameservers for this domain, which I have setup in my master domain."

How?

"Why does this not work... "

It depends on how you set things up. You may want to check out How To Create Vanity or Branded Nameservers with DigitalOcean Cloud Servers.
by Pablo Carranza
Learn how to create vanity or branded nameservers with your Droplets.
Hi, thank you for the reply! I have set up dns records fot this domain, like ns1.mydomain.com refers to the server IP.

I already read the article you refer to, but I don`t exactly get how to do it. Also, I want to start with just one VPS, and for that I need 2, only for the nameservers.

I`d hope there would be a simple solution to connect domains to my VPS. If I need to set up 2 VPS machines, and walk through all the steps for configuring my own nameserver, it will take way to much time, since I am going to need a few more extra VPS machines in the near future.

Why can`t just point all my domains to NS1 and 2.digitalocean.com, and connect the domains to my droplet? That would be so easy. But I am just a beginner on managing my own VPS-es (only used shared hosting before), so apologies for this probably foolish questions/statements
"Why can`t just point all my domains to NS1 and 2.digitalocean.com, and connect the domains to my droplet?"

You can, but why would you want to? At that point, you'd lose the safety net of redundancy and gain absolutely nothing. The article I previously cited to covers two possible configurations. Why not deploy Vanity Nameservers and let DigitalOcean handle the granular DNS-server configurations (all you'd have to do is create DNS records)?
Thank you. I did try with the setup to point to digitalocean, and that did work. But indeed, that is not really what I want.

I am very new on nameservers and hosting, so apologies for not having a clue how to set this correctly up.

Let me explain my setup more detailed:
- At domainregistar versio.nl I have registered 2 domainnames (for now, lets name it domain1.com and domain2.com
- Domain 1.com points to ns1 and ns2.digitalocean.com
- In virtualmin, I have added a server, named domain1.com
- in DNS management for domain1.com (in virtualmin) I added these records: ns1.domain1.com and ns2.domain1.com

- Now, I have registered domain2.com
- I have pointed the nameservers to: ns1.domain1.com and ns2.domain1.com
- I have created a 'sub-server' in virtualmin. I called this sub-server domain2.com. The parent server is thus domain1.com

however, this setup does not work. I read that I need to register ns1 and ns2 for this to work. But my domainregistar only gives 2 options:
- To change Nameserver (2 nameservers possible)
- To manage DNS records (like A records, etc)

What am I missing? My guess would be something in registring the nameservers, but I don`t know how to do that. I have read the article about vanity nameservers, and I think step 4 is where I get stuck. I just don`t know what to look for exactly at my registar
Hi, I have followed the tutorial for vanity nameserver. At step 4 I checked my registars possibilities and here is what I can do:
- Manage nameservers
- Manage DNS records of type A, Mx, Cname, PTR, AAAA, SRV and TXT.

I now added 3 A-records ns1, ns2 and ns3.domain1.com and as value I entered the ips for ns1, 2 and 3.digitalocean.com.

However, there was still an A record for my full domain, which points to the IP of the register. I now pointed that to the IP of my VPS.

Is this correct? Or is adding A records not the way to add glue records?
Glue records are not A records, they're two different things. I would contact the registrar and see if they support glue records.
Ok, I have contacted the registar, So I don`t need to change any ns records myself? I can just enter the nameservers voor my domain?
They told me this: you can set glue records by changing the domain nameservers, and adding an IP for each nameserver. Is that what I need to do, or will that still not work?
Have you not read this article: How To Create Vanity or Branded Nameservers with DigitalOcean Cloud Servers? That's exactly how Glue Records are described.
by Pablo Carranza
Learn how to create vanity or branded nameservers with your Droplets.
I have read that, but I also read that glue records where not the same as nameservers. But I got now a new e-mail from my registar and they say:
"You can just point al your A records to the IP of the VPS, that will solve this". But that is not in line with your comment "Glue records are not A records", so I am a little bit confused right now.

I will try with changing nameservers and adding the IP`s of the digitaloceans nameservesr there.

BTW, earlier you commented: "At that point, you'd lose the safety net of redundancy and gain absolutely nothing.". Is it really advisable to use own nameservers instead of digitaloceans`? I mean, how serious is the loss you describe. Because, in case my registar does not support glue records, then I will have to go with digitaloceans nameservers.

"I have read that, but I also read that glue records where not the same as nameservers."

The article does not suggest that Glue records are the same as nameservers.

"Is it really advisable to use own nameservers instead of digitaloceans`?"

It is not advisable to use only one of your own servers as a nameserver, in lieu of the 3 nameservers that DigitalOcean allows you to use, for free.

"I mean, how serious is the loss you describe."

Is not being able to access your server a "serious" issue, for you? Just like many things in life, there are few one-size-fits-all approaches when it comes to computing. If you're simply using this server as a sandbox in which to learn the intricacies of server management, then I would submit that it's well worth effort to learn how to manage your own nameserver. If your droplet is a production server, you'd be nuts to only use 1 nameserver AND -- even worse -- host that DNS server on the same server as your site(s)/app.

As wonderful of a service that DigitalOcean is, hardware failures; network problems; software bugs; and more, are a reality of computing-life that no one -- not Google, Amazon Web Services, GoDaddy, Linode, RackSpace, etc. -- are immune to. In the IT world, redundancy has always been a goal. It's just that for the longest time, it was cost-prohibitive. That is (only one of the big reasons) why DigitalOcean has been so successful, so fast: Now, you can have redundancy until your little heart is content, all the while not sacrificing quality and without breaking the Piggy Bank.

"Because, in case my registar does not support glue records..."

Perhaps it's time for a new registrar.
by Pablo Carranza
Learn how to create vanity or branded nameservers with your Droplets.
Thanks Pablo, you made it al much clearer now. I will definitively look for a new registar, and I agree that just using one nameserver would not be smart (yes, there is going to run production apps on the VPS..). I think, until I have more knowloedge of nameservers, I just will go with ns1, 2 and 3 of digitalocean. That seems like the most safe option right now.
Have another answer? Share your knowledge.