DNS and MX how do they work?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

DNS and MX how do they work?

Post by alex.barylski »

I have been trying to get a mail server setup on my host so I can offer clients email, but after much consideration I've decided to scrap the idea of hosting both mail and web sites on the same server. I'm running out of time I need something now and because I figure security, keeping two essnetial systems on seperate machines mitigates risk.

My web host I have pretty much setup the way I want, using name-based virtual hosting to server several sites with unique domains.

I am now looking into hosted email services and/or possibly renting another dedicated host and having someone setup a mail server.

Is what I want to do possible?

How does DNS work in this regard and how does MX come into play?

I use my hosting companies DNS records - which I pointed my registrar to already. Easy.

If I have one server which handles all HTTP requests for domain.com how do I get a entirely different (possibly remote) server to handle receiving and sending of emails?

If the DNS points to my web host server how does any email know that sales@domain.com should actually goto my second server, not the web host server?

Do I have to use an MTA still on my web host server and redirect email to the other server? Or is this where MX records come into play?

DNS and MX I understand are related but seperate. You can have a DNS with MX but not visa-versa??? You need a domain (DNS) before you can use email (MX) anyways, correct? Thats my reasoning anyways.

Can someone shed some light on how this is possible and what steps, etc I might need to take in order to get something like the above setup?

Cheers :)
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Well, just like you configured A and CNAME records in your dns server for 'regular' purposes... You can now add MX records (these will only be used for e-mail puproses..

Basically, you can have an A record that says example.com is at 123.456.789.123,
and at the same time you can say that the MX (mail-exchange) for example.com is handled by 321.987.456.123...

You can even add a 'priority' (lower means more reliable) to the MX record..
example.com. MX 123.456.789.123 5
example.com. MX 123.456.789.321 10 <- in case the host with priority 5 can't be contacted, this one will be used as backup

(An article like http://bobcares.com/article3.html will probably clear things up...)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Cool, thanks for the linkage there timvw. I'll look into it.

One problem though, DNS is a scary beast, so I used my hosting companies DNS. Does this mean I have to setup a DNS locally now? :?

Otherwise each time I add a domain to my server and associated emails I would have to ask my host to add the appropriate MX records?

Thanks again
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Does your host not give you the ability to edit your own Zone Records?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

nickvd wrote:Does your host not give you the ability to edit your own Zone Records?
I have no idea...it's a dedicated host so I have full control over my server but I use their DNS. Would the zone records not be on one of their machines? I will login in quickly and see if there isn't something like that in the admin.

Edit:

Ok Sweet. My admin panel does allow me to tinker with DNS stuff. Now I just need to figure it out and get another server setup for email. :)
Post Reply