Jump to content

understanding name servers


Drongo_III
 Share

Recommended Posts

I hope someone can help me understand this.

 

I have about enough knowledge of DNS to get by but there is something I am a tad confused by.

 

I have a vps server. If i point a domain hosted by a third party at my server using my name servers I then have to setup an mx record on the zone file (on my server) for email to work - even though the mx records are setup on the domain in the domain control panel (on 123 reg).

 

So am i right in thinking that everytime i point a domain at my server (which is setup as an addon domain) I need to also add the mx records into the zone file on my server?

 

Do the mx records on the domain host simply become obsolete when you repoint the name servers?

 

Any help in understanding this would be massively appreciated because i feel rather dumb for not quite grasping this... :/

Link to comment
Share on other sites

It depends on where the actual nameservers exist.

 

If you are using the nameservers at your registrar, you need to put your MX record on the registrar;  placing them on your server will do no good.  As long as your mail exchanger information doesn't change, you don't need to edit the MX record at the registrar unless you change mail hosting.

 

If, however, your VPS contains a nameserver (like if you are running cPanel), then you need to point the nameservers to your VPS at the registrar.  You then put your MX record in your cPanel zone file.  If you ever move nameservers to another server, you will need to move your MX record to the new server as well.

 

It's an either/or.  Domain names can (pretty much) only have one authoritative zone record (you can be on multiple nameservers, but that record better completely match on all of them or else really weird name resolution things happen), so you need to decide exactly where it will live and make sure your NS records at your registrar point there.

 

--The above was written by my friend Zoe, a linux tech and network tech at HostGator.  I don't know anything about this topic, but I knew she did.  I probably won't be able to do any follow-up answers.

Link to comment
Share on other sites

Thanks very much Dan! It's a bit of a confusing world when you get down to the nitty gritty of dns. I might well post a follow up question but don't worry if it's not your bag. Thank you very much for the info you have provided - it has helped me uderstand a bit more. :)

 

It depends on where the actual nameservers exist.

 

If you are using the nameservers at your registrar, you need to put your MX record on the registrar;  placing them on your server will do no good.  As long as your mail exchanger information doesn't change, you don't need to edit the MX record at the registrar unless you change mail hosting.

 

If, however, your VPS contains a nameserver (like if you are running cPanel), then you need to point the nameservers to your VPS at the registrar.  You then put your MX record in your cPanel zone file.  If you ever move nameservers to another server, you will need to move your MX record to the new server as well.

 

It's an either/or.  Domain names can (pretty much) only have one authoritative zone record (you can be on multiple nameservers, but that record better completely match on all of them or else really weird name resolution things happen), so you need to decide exactly where it will live and make sure your NS records at your registrar point there.

 

--The above was written by my friend Zoe, a linux tech and network tech at HostGator.  I don't know anything about this topic, but I knew she did.  I probably won't be able to do any follow-up answers.

Link to comment
Share on other sites

Ok so here is my follow up question (sorry it is so long).

 

Lets say my domain is hosted on 123 reg, and as above, I have my own vps server (with cpanel, whm) where i host my websites.

 

So if i want to set all records in 123 reg am i correct in doing the following and is my understanding correct?

 

[*]Change the A record (www and @) on the domain (on 123 reg) to point at my vps server where an addon domain is setup for it

[*] keep the nameservers set to 123 reg (so this is the main authorative name server where dns lookups are made)

[*] Setup the mx record on 123 reg - because this is where the dns system will look for my mx record with nameservers set to 123 reg

 

Does that all sound correct?

 

If so then here's scenario two:

 

Am i right in thinking that if i change the name servers on 123 reg, so that they are now set to my own vps server's name servers, that i now need to setup the zone file on my own server for MX, WWW, @ etc. because now dns lookups are routed to my server instead of using 123 reg? Is that correct?

 

If so i think the penny has finally dropped and i understand the distinction.  If not, please tell me where i am wrong :)

 

I am really keen to understand this as i operate on my own so  i don't really have anyone to bounce this off and if i don't understand it then i might inadvertently make a mistake :/

 

Many thanks,

 

Drongo

 

Link to comment
Share on other sites

More from Zoe:

 

 

 

If you are running cPanel, I highly, highly recommend, both for your sanity and the sanity of any support personnel who access your server, that you use cPanel's integrated nameservers.  Simply point the NS records from your registrar to your cPanel box, and let cPanel handle all your domain records.

 

If your mail is handled by cPanel, your MX records are automagic.  They just work.  Add subdomains?  Just work.  Add SPF or domainkeys?  Just work.

 

You then manage your DNS records in cPanel under the "Simple DNS Zone Editor" or "Advanced DNS Zone Editor."  The zone editors check your records for sanity, so your nameserver won't fail due to malformed records or anything.

 

Because you're running cPanel, you have a nameserver running ANYWAY, managed by your panel, so I highly recommend you use it unless you have a very specific reason to avoid it.  One final pitch (as a professional support technician) your support tech will appreciate having all records handy in case of repair... and you'll appreciate not having to play go-for between support and your registrar when (not if, it's DNS, this stuff happens) things change.

 

WITH ALL THAT SAID, I hate when people don't answer the question I ask, so in answer to your question, your checklist in your followup question is technically right and will work.  Re scenario two, no;  if you point your NS records to your VPS they will automatically work (after 24-72 hours as the DNS catches up it's caches) because cPanel manages them (see my overly wordy sales pitch above).

 

The biggest thing to know about DNS is that there is one-only-one authoritative nameserver.  All other nameservers have NS records which point to the authoritative nameserver.  You just need to pick which server is the authoritative nameserver, and make sure all others point to it.  It can be any server you want, but with cPanel it's best to use the built in one for sanity's sake.

Link to comment
Share on other sites

Hi Dan

 

Thank you so much for your response! I think I am finally starting to understand how this works in practice and how to set things up correctly.

 

What sparked my question was a client who wants me to host their website but  have their own mail server and want to keep the mx records as they are. And this got me wondering how well i understand this and whether i actually need to amend the zone file for the addon domain everytime or not (which i now realise i don't). 

 

The thing is there are lots of guides on dns - "what are name servers", "what does @ mean" etc. - but a discription of the elements that make up dns feels like a long way from how all the component parts work together in the real world when you have domains hosted with one company and a server for web space hosted with another. I shall keep reading up on it until i've fully cracked it but you may yet be bombarded with more questions on this hehe ;)

 

 

 

More from Zoe:

 

 

 

If you are running cPanel, I highly, highly recommend, both for your sanity and the sanity of any support personnel who access your server, that you use cPanel's integrated nameservers.  Simply point the NS records from your registrar to your cPanel box, and let cPanel handle all your domain records.

 

If your mail is handled by cPanel, your MX records are automagic.  They just work.  Add subdomains?  Just work.  Add SPF or domainkeys?  Just work.

 

You then manage your DNS records in cPanel under the "Simple DNS Zone Editor" or "Advanced DNS Zone Editor."  The zone editors check your records for sanity, so your nameserver won't fail due to malformed records or anything.

 

Because you're running cPanel, you have a nameserver running ANYWAY, managed by your panel, so I highly recommend you use it unless you have a very specific reason to avoid it.  One final pitch (as a professional support technician) your support tech will appreciate having all records handy in case of repair... and you'll appreciate not having to play go-for between support and your registrar when (not if, it's DNS, this stuff happens) things change.

 

WITH ALL THAT SAID, I hate when people don't answer the question I ask, so in answer to your question, your checklist in your followup question is technically right and will work.  Re scenario two, no;  if you point your NS records to your VPS they will automatically work (after 24-72 hours as the DNS catches up it's caches) because cPanel manages them (see my overly wordy sales pitch above).

 

The biggest thing to know about DNS is that there is one-only-one authoritative nameserver.  All other nameservers have NS records which point to the authoritative nameserver.  You just need to pick which server is the authoritative nameserver, and make sure all others point to it.  It can be any server you want, but with cPanel it's best to use the built in one for sanity's sake.

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.