LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   MX Records / A Records / CNAME Records - Advice Please (http://www.linuxquestions.org/questions/linux-newbie-8/mx-records-a-records-cname-records-advice-please-856658/)

fusion1275 01-16-2011 11:19 AM

MX Records / A Records / CNAME Records - Advice Please
 
Hi all,

I will give you a short background on what I currently have and what I am attempting to do.

So far I have a server sitting in the cupboard which does the following:

Quote:

1. Hosts a website using www.myserver.net address via apache
2. Acts as an FTP site when I enter ftp myserver.com in filezilla for example
3. Acts as an SSH server from putty for example
4. Hosts my mail using my ISP's smtp servers but using fetchmail/postfix/dovecot/spamd/freshclam etc etc
5. Able to use squirrelmail to check my mail when not at home
I have had this setup for over 2yrs now and its been running like a dream until my ISP has announced its shutting shop and I will have to look for a new broadband provider.

So... The story so far is, I have now been connected to my new ISP but they do not host any email. So no smtp servers to connect to.

This has now given me an idea to add to/reconfigure my existing mail server but adding a new domain name to it to use strictly only for mail.

ie
Quote:

Server name = www.myserver.net (as I mentioned above) but with a secondary domain of mymail.com so I can host bignost@mymail.com and mrsbignose@mymail.com.
I have now got the domain registered. I have found a suitable site in the UK to host the DNS and all is happy. The only thing I am not sure about now is how to setup the mail side of things on the DNS site.
Im sure they are kinda all the same so I will have a stab at the setup and hopefully someone can correct me if I talking rubbish

Quote:

NS1 - mymail.com - Works Fine!
NS2 - mymail.com - Works Fine!
NS3 - mymail.com - Works Fine!
NS4 - mymail.com - Works Fine!

mymail.com - A record -> Static IP provided by ISP
www.mymail.com - CNAME -> mymail.com
mail.mymail.com - MX record (10)-> mymail.com
smtp.mymail.com - MX record (5) -> mymail.com
Any suggestions would be a great help indeed.

Thanks in advance

jmc1987 01-16-2011 11:49 AM

You need a . after ever fQD or otherwise it is read like this

smtp.mymail.com MX 5 mymail.com

would look something like this

smtp.mymail.com.smtp.mailmail.com.mymail.ocm.mymail.com

Be sure to add the period (.) after every FQD so it doesn't repeat it self like its meant to be a subdomain

bathory 01-16-2011 12:04 PM

Quote:

mail.mymail.com - MX record (10)-> mymail.com
smtp.mymail.com - MX record (5) -> mymail.com
With the above snippet, I guess you mean that the MX records for the domain mymail.com are mail.mymail.com with priority 10 and smtp.mymail.com with priority 5.
In this case you need to add the A records for the 2 hosts (mail.mymail.com, smtp.mymail.com)

Regards

fusion1275 01-16-2011 12:37 PM

Hey thanks for the replies!!

JMC - All I need to do in the webpage of the DNS management company is add the names in. There is a box to enter the name in. I am guessing that the webpage will add the "." after the name is saved. It basically looks like this on the webpage:

Code:

[ mail ].mymail.com
or
[ smtp ].mymail.com

In the example above I have entered manually the word "mail" and "smtp" in the box provided and the DNS company has filled in the blanks for me.

Hope that makes sense? ;)


bathory - Yes you are correct in your guess. I basically have the 2 MX records that point to the single A record. So I now need to create 2 extra A records for the mail and smtp hosts and point them to??? The domain name mymail.com? or the static IP? Or doesnt it really matter?

Thanks all

fusion1275 01-16-2011 12:41 PM

Actually I have just tried entering in the new A records and it only lets me point to the static IP so ignore my last comment. Still learning this stuff :)

fusion1275 01-16-2011 12:43 PM

So this now my setup on the DNS management site:

Quote:

NS1 - mymail.com - Works Fine!
NS2 - mymail.com - Works Fine!
NS3 - mymail.com - Works Fine!
NS4 - mymail.com - Works Fine!

mymail.com - A record -> Static IP provided by ISP
mail.mymail.com - A record -> Static IP provided by ISP
smtp.mymail.com - A record -> Static IP provided by ISP
www.mymail.com - CNAME -> mymail.com
mail.mymail.com - MX record (10)-> mymail.com
smtp.mymail.com - MX record (5) -> mymail.com


What do you think??

bathory 01-16-2011 12:50 PM

You don't need 2 MX RRs since they both actually point to the same host. You use 2 MXs for redundancy, so if the 1st goes down, the 2nd will take over. Since you have only one public IP, it's useless.
Other than that the setup looks OK.

Regards

fusion1275 01-16-2011 01:01 PM

I was under the impression that I would need the MX records as that is what transports my mail to my server once configured?

I had this picture in my head (basically):

Quote:


User sends new mail --> Mail goes to their ISP's MTA etc etc --> Flies through the internet cloud --> Looks up my DNS MX for the domain name --> Gets pointed to my IP and handshakes --> Mail comes to my server --> First part of the mail "bignose@mymail.com" gets picked up with postfix and then placed in a holding area (mailbox) for the user.
Can you maybe break it down for me.

Thanks

bathory 01-16-2011 01:26 PM

Maybe I didn't make myself clear. You need a MX record to define the mail server that will accept mail for your domain.
Quote:

I basically have the 2 MX records that point to the single A record
If you want to use a 2nd MX as a backup, it has to use a different IP
So the 2nd MX record in your case is useless as it points to the same host (mail.mymail.com and smtp.mymail.com are actually different hostnames for a single box listening on your unique public IP).

fusion1275 01-16-2011 01:40 PM

OK so now I'm a little confused as to what to point the MX record to.

Can you advise please using the below setup I now have:

Quote:


NS1 - mymail.com - Works Fine!
NS2 - mymail.com - Works Fine!
NS3 - mymail.com - Works Fine!
NS4 - mymail.com - Works Fine!

mymail.com - A record -> Static IP provided by ISP
mail.mymail.com - A record -> Static IP provided by ISP
smtp.mymail.com - A record -> Static IP provided by ISP
www.mymail.com - CNAME -> mymail.com

How about:

Quote:

smtp.mymail.com - MX record (10) -> mymail.com
Sorry and thanks for your assistance

bathory 01-16-2011 01:56 PM

What I mean is that your domain should have a MX RR, but a 2nd one is useless in your case, as in practice both MXs will point to the same IP.
So the setup should look this this:
Code:

NS1 - mymail.com - Works Fine!
NS2 - mymail.com - Works Fine!
NS3 - mymail.com - Works Fine!
NS4 - mymail.com - Works Fine!

mymail.com MX record -> mail.mymail.com

mymail.com - A record -> Static IP provided by ISP
mail.mymail.com - A record -> Static IP provided by ISP
smtp.mymail.com - A record -> Static IP provided by ISP
www.mymail.com - CNAME -> mymail.com


fusion1275 01-17-2011 03:25 PM

As per the website I can do the following:

Quote:

mail.mymail.com MX record -> mymail.com
But it wont let me do...

Quote:

mymail.com MX record -> mail.mymail.com
As you suggested because it has an empty box that has ".mymail.com" filled in afterwards as I said above to jmc1987. This is what it looks like:


Code:


Host:
[      ].mymail.com

Points to:
[      ]

MX Priority:
[10]

TTL:
[1 Hour]

So all I do is fill in the blanks in effect and below is a snippet of my new DNS layout. I hope this is now correct!?!

Code:

        Host                        Type        Points to                 
        mymail.com                NS        ns1.cloudns.net         
        mymail.com                NS        ns2.cloudns.net         
        mymail.com                NS        ns3.cloudns.net         
        mymail.com                NS        ns4.cloudns.net         
        mymail.com                A        81.92.143.66         
        mail.mymail.com        A        81.92.143.66
        smtp.mymail.com        A        81.92.143.66         
        mail.mymail.com        MX        10 mymail.com       
        www.mymail.com                CNAME        mymail.com

Thanks

bathory 01-17-2011 04:55 PM

It's not correct.
You should define the MX RR for the whole domain mymail.com. From the snippet posted you define mymail.com as the MX RR for the subdomain mail.mymail.com. The configuration should look like this:
Code:

mymail.com  MX  10 mymail.com
Didn't use a trailing dot after mail.com because you said that it's added by the panel software. Otherwise you need a trailing dot after every FQDN

fusion1275 01-18-2011 03:10 AM

Code:

It's not correct.
You should define the MX RR for the whole domain mymail.com. From the snippet posted you define mymail.com as the MX RR for the subdomain mail.mymail.com. The configuration should look like this:
Code:
 

       
Code:

       
mymail.com  MX   10 mymail.com

Didn't use a trailing dot after mail.com because you said that it's added by the panel software. Otherwise you need a trailing dot after every FQDN


I'm sorry I posted the wrong snippet. I was mean't to post this instead but by what you have said in your last post it is still incorrect but I followed your previous advice and pointed my domain to my mail.mymail.com host.

Code:

        Host                        Type        Points to                 
        mymail.com                NS        ns1.cloudns.net         
        mymail.com                NS        ns2.cloudns.net         
        mymail.com                NS        ns3.cloudns.net         
        mymail.com                NS        ns4.cloudns.net         
        mymail.com                A        81.92.143.66         
        mail.mymail.com        A        81.92.143.66
        smtp.mymail.com        A        81.92.143.66         
        mymail.com                MX        10 mail.mymail.com       
        www.mymail.com                CNAME        mymail.com

So this is also incorrect and it should be this???

Code:

        Host                        Type        Points to                 
        mymail.com                NS        ns1.cloudns.net         
        mymail.com                NS        ns2.cloudns.net         
        mymail.com                NS        ns3.cloudns.net         
        mymail.com                NS        ns4.cloudns.net         
        mymail.com                A        81.92.143.66         
        mail.mymail.com        A        81.92.143.66
        smtp.mymail.com        A        81.92.143.66         
        mymail.com                MX        10 mymail.com       
        www.mymail.com                CNAME        mymail.com

Thanks

bathory 01-18-2011 03:48 AM

Yes the 2nd one:
Code:

Host                                Type              Points to                 
mymail.com                NS              ns1.cloudns.net         
mymail.com                NS              ns2.cloudns.net         
mymail.com                NS              ns3.cloudns.net         
mymail.com                NS              ns4.cloudns.net         
mymail.com                A              81.92.143.66         
mail.mymail.com        A              81.92.143.66
smtp.mymail.com        A              81.92.143.66         
mymail.com                MX  10    mymail.com       
www.mymail.com        CNAME  mymail.com

is ok.
You have define a MX RR (mymail.com) for your domain and the MX host has an A RR.


All times are GMT -5. The time now is 11:31 AM.