How to setup virtulamin / webmin to host websites and namerservers respectively?

SYSTEM INFORMATION

OS type and version: Ubuntu 20.04
Ram: 8GB
CPU: Intel Xeon

Hi, all! First of all I would like to thank all for your help in advance. I have been using virtualmin for quite some time now hosting indivdual websites on individual servers for either perosnal use or friends and family so I have some experiance however I am still learning.

My question is as follows. I would now like to host multiple sites under one virtualmin server and setup my own custom nameservers. I understand how to setup multiple websites on one server using “virtual servers” but its the DNS part of it all I slip up on. Since before I was hosting individual sites and having their DNS managed by the domain registrar ie godaddy or namecheap I never ran into any problems configruing DNS as I more or less understand DNS records and how it all works. However now I would like to make things a bit more neat and tidy from my end at least.

I am sure that all of you know that when you register a new domain you can either have the registrar host/manage your DNS or enter custom nameservers to another DNS of your choice ie cloudflare. This is exaclty what I would like to do. I would like to setup a dedicated DNS server using either virtualmin or webmin (don’t know which is best) that will not host any websites but just their DNS records. On a seperate server running virtualmin I will have multiple websites hosted with different domain names which will have their DNS hosted and managed by the earlier mentioned DNS server. The websites domains will have for example the nameserver ns1.mydnsserverdomain.com and ns2.mydnsserverdomain.com registered at their domain registrar ie namecheap or godaddy.

The structure I wish to pursure is haveing 2 seperate severs hosted on my own network pointing to the outside. One server will be for DNS and the other to host the websites. Both will use virtualmin/webmin.

I would like to have this setup in this way or a similar way in order to make things neat and tidy on my end as well as not having to jump about different DNS servers. Is this possible, if so how would you go about doing this. From what I read in the forums it should be possible using BindDNS, its just how do you set it up?

Any help regarding this would be greatly appreciated.

Kind regards Sam

You set up Virtualmin the exact same way you set up your website anywhere else.

You can read about name server setup here.

After that, you point your domain to your name servers just like you did when you hosted with someone else.

Create the virtual server for whatever domain you want.

Any records you need to add are done on that virtual server / server configuration / DNS records tab.

It’s just that simple.

Edit to add: If you don’t want to have to mess with setting up name servers you can use Cloudflare. Simply create a free account there, point any domain you have to the name servers Cloudflare gives you, then create the records in Cloudflare and point them to your servers IP address.

Done.

Hi Gomez, thank you for your reply.

Does this mean that I need two servers, one to act as the DNS server and one for hosting the multiple websites? I would like to have it setup just like godaddy or namecheap have it setup.

For example,
if I have purchased a domain from namecheap and wish to use it with a godaddy hosting plan I simply change the domain’s nameservers at namecheap to godaddy’s. This then links my domain with my hosting plan and lets me manage all my DNS entries at godaddy not namecheap. Godaddy has millions of websites all using different domains yet they have one set of namservers for all (same as cloudflare). From my understadning this is how it works and wish to do the same as I have multiple sites of different domains to manage and wish to put them under one server. My aim as mentioned is to have a seperate DNS server for all my domains and a seperate hosting server which hosts my sites.

Please correct me if I have got anything wrong but that is my understanding of how it works and wish to set it up the same.

Any help would be greatly appreciated.

Kind regards Sam

No. One with Virtualmin on it does it all.

If you have no experience in setting up things like that you have two options:

  1. Hire somebody to set up your Virtualmin server for you.
  2. Use Cloudflare.

That’s how Virtualmin works. It’s a shared hosting provider. One server with one installation of Virtualmin can serve as many websites as your hardware can handle.

Again, all you have to do is know how to set it up. It’s not that difficult. You should be able to be up and running from a completely blank server in about an hour. If you decide to do it yourself, then this is the best advice I can give you:

What you should do first is install Virtualmin by the directions. They’re very, very simple:

  1. Install your OS. You say you have Ubuntu 20.04. It needs to be the LTS version. Install it and DO NOT ADD ANYTHING TO IT. Do not modify it in any way. No matter what you think you need to install or set up, DO NOT DO IT. If you already have, delete that install and reinstall it and do not add or modify a single thing.

  2. Run this command: # wget https://software.virtualmin.com/gpl/scripts/install.sh

  3. Run this command: # sudo /bin/sh install.sh

Once that’s done, you’ll need to go through the post install setup dialogue. Once you’ve done that, you’re ready to start hosting sites.

You can either set up your own nameservers to run your DNS or use Cloudflare to do it. For a beginner, I highly recommend you use Cloudflare.

If you want your server to be your own nameservers and handle all DNS and you registered at Namecheap, then you follow these directions from Namecheap.

Wherever you register will have similar instructions to that. Cloudflare is self explanatory.

Either way, once that’s done then you simply enter the records you need in DNS to run any site you want and point the nameservers from your registrar to whatever service you’re using, be that your own server or Cloudflare.

Thank you very much I understand it now.

Kind regards Sam

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.