Howdy Jeremy,
What I want to do is be able to control all sub-domains of example.com on my server with Virtualmin. Ie I want example.com to point to my server but then have my server (Virtualmin) take care of all sub-domains / DNS.
Does that make sense?
Of course. That’s what DNS is all about.
If you set your nameserver at your registrar to the address of your server (IP or name…some registrars have started making it very difficult to bootstrap a new domain for new users–they want you to enter a name and don’t accept an IP to go with it, but if you don’t already have working DNS service for another zone, you can’t point things to the right place…quite annoying), your server will then be authoritative for that zone (example.com is the zone in your post above…it also happens to be a domain name, but for DNS delegation purposes it is a zone).
You can further delegate zones to other name servers within your domain (sub.example.com could be delegated to another server, which would be authoritative for sub.example.com, sub.sub.example.com, etc.). But don’t worry about that.
For you purposes, you simply want to set your registrar to list your server as the authoritative name server for your zone. Virtualmin takes care of the configuration on your server.
And yes, you can create any kind of website on sub1.example.com. It could be an alias, a forward, a sub-server of example.com or some other virtual server or a standalone website. Names are just names. Virtualmin will get the right bits into the name server, so you don’t need to think about the names at all…just create the servers in the way that makes them most useful to you and your users. If sub1.example.com is administered by the same person as example.com, just make it a sub-server owned by “example”. If a different person administers it, create a new virtual server with its own username and password and home.
And, if you happen to have access to another server, it can act as your secondary (if not, just give your primary box a second IP and use it for the secondary). Setting up a DNS slave is easy, and documented here:
http://www.virtualmin.com/support/documentation/virtualmin-dns-slaves/
If you want to understand more than just “point your registrar to your Virtualmin server and let us do the rest”, I’d suggest checking out the following docs:
There’s a bit of a break down of how DNS works in my book, here:
http://www.virtualmin.com/support/documentation/thebookofwebmin/ch08.html
And, if you still feel lost, I cannot recommend highly enough the book mentioned here:
http://www.virtualmin.com/recommended-reading/book-view?book_no=5
It’s among the finest of O’Reilly’s books.
And, of course, feel free to ask for clarification if you don’t understand anything I’ve just said. DNS can be confusing…there are so many terms that get misused (even by people who know better…like me), it becomes difficult to keep up with who’s talking to whom about what.