Simple DNS overview (if that's possible)

4 posts / 0 new
Last post
#1 Wed, 02/21/2007 - 00:13
JeremyReynolds

Simple DNS overview (if that's possible)

I know DNS is complicated...are you able to help me understand the journey? My overall objective is to serve websites for example.com, sub1.example.com, sub2.example.com, domain.com, sub1.domain.com, sub2.domain.com. My understanding is this:

1- Domain name example.com registered with registrar 2- Domain name delegated to Name Servers 3- Name server points domain to server with public IP 4- Server (with Virtualmin of course) serves pages with named based virtual hosts

Assuming that is correct, I'm ok with point 1 and 2. Re point 3...I've got an 'A' record pointing 'example.com' to my server's public IP, Virtualmin has setup a virtual server 'example.com' and all is sweet (I'm using freedns.afraid.org to experiment). Next, using Virtualmin I create sub1.example.com as a sub-server (I'm guessing I could create any kind of server with sub1.example.com domain?). At the moment, I have to then go to the DNS hosting (afraid.org) and create a sub-domain 'A' record that points to my server's public IP (along with www, ftp, mail variations). This works but....

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?

Wed, 02/21/2007 - 15:51
Joe
Joe's picture

Howdy Jeremy,

<i>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? </i>

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 &quot;example&quot;. 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 &quot;point your registrar to your Virtualmin server and let us do the rest&quot;, 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%5fno=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.

--

Check out the forum guidelines!

Wed, 02/21/2007 - 16:09
JeremyReynolds

Thanks for all that info Joe - and for the speedy reply. You're filling me with confidence that Virtualmin is the right tool for our organisation!

I'll take a look at all that info and post again if I get stuck. Thanks.

Thu, 02/22/2007 - 01:08
JeremyReynolds

ok...I read through all the docs you suggested and I've even ordered a couple of books. In the meantime.....

I've created ns1.example.com and ns2.example.com - still waiting for the change to make its way through the net. I pointed ns1 to my server's public IP, and ns2 to another server's public IP (I'll try getting the secondary stuff happening once the primary is working).

Now, the host name on my server is: web1.example.com. When I create virtual servers in Virtualmin, it automatically assigns one nameserver to web1.example.com. This needs to be changed to ns1.example does it not?

If this is correct, does this mean I should change the host name of the machine to ns1.example.com?

Virtualmin only creates one NS record for the Virtual server. Do I need to add a second - eg ns2.example.com. ?

I've wondered if I need to open a port for DNS to work (on both linux box and router)? Is this so? Do I need to open port 53?

Thanks Joe - looking forward to getting this part sorted - doing my head in!