LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
LinkBack Search this Thread
Old 01-16-2011, 11:19 AM   #1
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Mint 13
Posts: 261

Rep: Reputation: 35
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
 
Old 01-16-2011, 11:49 AM   #2
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 865

Rep: Reputation: 110Reputation: 110
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
 
Old 01-16-2011, 12:04 PM   #3
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,772

Rep: Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294
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
 
Old 01-16-2011, 12:37 PM   #4
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Mint 13
Posts: 261

Original Poster
Rep: Reputation: 35
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
 
Old 01-16-2011, 12:41 PM   #5
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Mint 13
Posts: 261

Original Poster
Rep: Reputation: 35
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
 
Old 01-16-2011, 12:43 PM   #6
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Mint 13
Posts: 261

Original Poster
Rep: Reputation: 35
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??
 
Old 01-16-2011, 12:50 PM   #7
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,772

Rep: Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294
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
 
Old 01-16-2011, 01:01 PM   #8
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Mint 13
Posts: 261

Original Poster
Rep: Reputation: 35
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
 
Old 01-16-2011, 01:26 PM   #9
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,772

Rep: Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294
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).
 
Old 01-16-2011, 01:40 PM   #10
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Mint 13
Posts: 261

Original Poster
Rep: Reputation: 35
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
 
Old 01-16-2011, 01:56 PM   #11
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,772

Rep: Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294
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
 
Old 01-17-2011, 03:25 PM   #12
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Mint 13
Posts: 261

Original Poster
Rep: Reputation: 35
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
 
Old 01-17-2011, 04:55 PM   #13
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,772

Rep: Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294
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
 
Old 01-18-2011, 03:10 AM   #14
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Mint 13
Posts: 261

Original Poster
Rep: Reputation: 35
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
 
Old 01-18-2011, 03:48 AM   #15
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,772

Rep: Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CNAME records sci3ntist Linux - Server 4 09-08-2009 05:38 AM
Reading caller detail records(CDR ) records eliufoo Linux - Networking 2 12-16-2008 11:31 PM
Email configuration -CNAME records - on server File.am Linux - Server 2 10-19-2007 08:18 AM
DNS Zone Records - MX Records ddzc Linux - Software 8 05-24-2007 01:26 PM
Do we really need CNAME records in DNS? ivj Linux - Networking 3 05-19-2006 03:49 PM


All times are GMT -5. The time now is 01:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration