[SOLVED] MX Records / A Records / CNAME Records - Advice Please
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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)
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?
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
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
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.
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.
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).
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
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
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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.