DNS explanation required

Hi

I’m having trouble fully understanding how the DNS system works in general and with Virtualmin… in the past most of my sites have been hosted on shared hosting using cpanel or something similar. Iv not had to worry about setting up DNS all I had to do was add the domain on in cpanel and point my domain in godaddy to specified nameservers and it all worked fine and dandy!

Iv got a cheap VPS that’s got Ubuntu 8.10 installed and updated and has two ip addresses. I basically got this VPS to play with a learn on before moving any live websites over to it.

So far iv managed to get virtualmin installed and working with the install script.

now comes the confusing bit for me…

When setting this up it asked for a fully qualified domain name, does this mean it requires one of my actual registered domain names that I intended to use for a website? If so why?

I had planned to setup the VPS and host two completely separate sites each having its own IP address ( I know this isn’t necessary) and domain name associated with it. But now Im not sure what to do, should I use the domain name of the main site as the host name? I’m kinda lost here…

can somebody explain to me in layman’s terms how to set this up correctly, so that I will have working nameservers to point my individual domains names to that I will use for each virtual server.

cheers

Well, DNS is an involved beast. You might consider investing in a book such as O’Reilly’s “DNS and BIND”, which I really liked – it helped me learn the ins and outs here.

A fully qualified domain name (FQDN) is a name like:

foo.example.com

That is, a hostname followed by a domain name.

Your server will need a FQDN – it needs to be using a domain name that you own. If you have a domain name you’d consider the “main” one for your site, I might choose that.

If you’re looking to setup your server as a nameserver, you’ll need to register it as a nameserver with your domain name registrar.
-Eric

Iv been reading and sort of understand what is going on. But Do I really need to use my VPS as a name server or could I use free domain services such as Afraid.org?

Also is it not possible to use the nameservers of my VPS provider? Why is it desirable to have your own private nameservers on a VPS in the first place?

I contacted my provider and I do have to setup my own!

Would it be better to try and do this via webmin rather than virtualmin?

there seems to be more info out there on how to do this via webmin

Well, some domain name registrars – GoDaddy is an example – offer free DNS service.

So if you’re using a registrar similar to GoDaddy, instead of needing to act as a nameserver, you could simply enable the DNS service there, and point the various records to the IP addresses on your VPS.
-Eric

I am using godaddy! Wasn’t aware I could do that, where do I look for the info on this in godaddy?

There is a module under Webmin - Networking - Network Configuration - Hostname and DNS Client
that is where you organise this for a start.

You need a domainname at a registrar where you can register the 2 IP’s for your nameservers.
This is not the same as changing nameservers for a domain.

Your registrar will announce the 2 IP’s and the domainname to the world. Not all registrars do this. (namecheap.com does and you can do it from your account there)

So now the world knows where to find your domain and any other domain on your box using your nameservers. Then in the module you write for instance server.domainname.com or ns.domainname.com or dns.domainname.com. You get the picture.

At DNS servers in that part you would have the local IP 127.0.0.1 and the 2 IP’s (nameservers) of your ISP (so not your own) because the ISP needs to find your machine when a request comes in.

Then under Host Addresses you’ll bind the IP’s to the names.

Under Network Interfaces you can create a virtual iface to venet0:0 called venet0:1 and add the 2nd IP

In the servers template under BIND DNS domain (BIND DNS records for new domains) fill in ${DOM}. 38400 IN NS ns2.domainname.com.

thats how i did it

andreychek: Does this come under total DNS control in godaddy?

And how does this affect the rest of virtualmin such as each domain and sub-domains for the virtual servers?

So, there’s two ways to setup DNS for your server:

  1. Let someone else do it

  2. Do it yourself

Both have benefits and drawbacks :slight_smile:

Ronald’s excellent writeup described #2, how to do it yourself.

If you want to let someone else do it – such as GoDaddy – then yes, you’d set that up using GoDaddy’s Total DNS Control.

How does that affect your Virtual Servers?

It means that anytime you add a new domain or sub-domain to your system, you have to go back to GoDaddy, and add the domain and IP address into Total DNS Control.

If you don’t intend on adding new domains very often, that’s not a big a deal.

If that happens a lot, you may end up finding that to be inconvenient.
-Eric

Ok and will they make a difference to me when setting up email accounts on domains/ virtual servers as I see in the total DNS control I have the option to edit all the mail settings and everything.

What are the main things I should change when using Total DNS control to point to my servers?

obviously first is the actual ip address

I have :

www @ 1 Hour

mobilemail 	mobilemail-v01.prod.mesa1.secureserver.net 	1 Hour

pda 	mobilemail-v01.prod.mesa1.secureserver.net 	1 Hour

email 	email.secureserver.net 	1 Hour

imap 	imap.secureserver.net 	1 Hour

mail 	pop.secureserver.net 	1 Hour

pop 	pop.secureserver.net 	1 Hour

smtp 	smtp.secureserver.net 	1 Hour

ftp 	@ 	1 Hour

webmail 	webmail.secureserver.net 	1 Hour

e 	email.secureserver.net

In the host section of total DNS control I have two sections to fill in

In the first section I put in the hostname of my server and pointed it to one of my ip addresses and set ttl to 30mins

what do I put in the second host section that currently only has @ in it?

Also I take it with total dns control I can point the www.mydomain.com to my server but still use godaddy’s free email service with the domain by not changing the email setting in total dns control?

First, I’d get rid of all the domains/sub-domains GoDaddy setup by default, and start over :slight_smile:

If your domain is “example.com”, you basically want to setup a number of records to point at your server – that includes example.com, www.example.com, admin.example.com, webmail.example.com, and mail.example.com – along with anything else you want to resolve to your address – and you need to make sure they’re all going to your server by setting them up as address and/or cname alias records.

Regarding GoDaddy’s free email service – you have to choose whether you want email going to your server, or to GoDaddy – you can’t have both unfortunately :slight_smile:

I wouldn’t worry about the TTL’s, you can leave those at the defaults.
-Eric

Well I would rather just keep the email at godaddy at least if my server goes down my email will continue to function. How do I do that?

Howdy,

Well, I’m not an expert on how to setup DNS/email on GoDaddy, but in general, it means:

  • You need to have an MX record setup in your DNS (ie, Total DNS Control) that points to GoDaddy. I believe this is the default, so you may not have to do much there

  • You’ll want to disable the “mail” and “dns” features in Virtualmin so that your server understands it doesn’t need to do those things (in System Settings -> Features and Plugins).

ahh but will doing this still allow some of the virtual servers to still have email running from them. Its just mail account from my main domain I want to keep at godaddy.

Yeah, it’s per-domain.

You could have one domain send email to GoDaddy, and others send their email to your server.
-Eric

arrrghh Im just totally lost now mate, the more I read the more confused I become… I need some kind of step by guide on either how to setup my own private nameservers on my vps with webmin/virtualmin or a Step by step guide on how to use the godaddy dns service either way I just want this shit to work…most of the webmin how to’s iv found have been out of date and the icons settings pages it tell you to click dont even exist in my version.

How do I change the host name in webmin? I never used a FQDN when setting up just mydomain.info

I agree that a DNS step-by-step guide would be helpful.

But we don’t have one yet :slight_smile:

DNS is a complex beast, and it’ll take some time to create that.

Ronald offered a pretty detailed explanation above on how you might go about setting up your own server as a nameserver.

If it’s just not clicking for you, you might consider tossing a few dollars someone’s way to have them guide you through each step of the process, since there’s a lot of moving parts involved here.

For example, you may be able to talk Ronald into that :slight_smile:

However, we will have a DNS step-by-step guide online at some point.

As far as changing your hostname – you can do that in Webmin -> Networking -> Network Configuration -> Hostname and DNS client.
-Eric