SOLVED Setup mail server and Cloudflare DNS

caseyj0

Member
Nov 4, 2009
24
2
53
Hello,

I need to setup my email server host with Cpanel while my nameserver and DNS are with cloudFlare. Would someone recommand a guide or tuto please ?
(I spent days without success to do that ... :((....)

Thanks a lot.
Khampol.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,260
2,220
363
cPanel Access Level
Root Administrator
Hey there! If the DNS is being handled by a remote service you would just need to make sure your MX record is pointed to your cPanel machine in DNS. The easiest way to do that is to make sure your DNS looks similar to the following:

domain.com. IN MX mail.domain.com.
mail.domain.com. IN A x.x.x.x

where "x.x.x.x" is the IP address of your cPanel machine.

Can you try that and see if that gets things working for you? You will likely need to allow for a bit of DNS propagation time while that change makes its way around the internet.
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
823
342
363
cPanel Access Level
DataCenter Provider
If you are using CloudFlare for DNS I'd highly suggest turning off the proxy feature (click the orange cloud to make it grey) for your MX record(s) and any DNS records you are using in your email client (like mail.yourdomain.tld) as that will cause you nothing but grief. The proxy/fiirewall is intended for Web, not mail.
 

caseyj0

Member
Nov 4, 2009
24
2
53
Hello,
sorry for my late reply.
We see here my config in cpanel and CL. I think all is correct.

CL

0000capt1.png
cpanel " Email Deliverability"

0000capt2.png

If i try to ping the mail server the IP is good but i have 100% loss... I use pfSense.

0000capt3.png
I think to open all necessery ports in it....

0000capt4.png

.. Otherwise the web http and https work very well.

I am stuck for days now.... .... :((
 
Last edited:

caseyj0

Member
Nov 4, 2009
24
2
53
Ping isn't a reliable indicator of service, as many routers block ping traffic by default. It would be a better idea to use a tool like "dig" to check the DNS records, or an online tool to check the records.
ok i check that. But overall what o u think? My setup looks ok ?
 

caseyj0

Member
Nov 4, 2009
24
2
53
No, you just look up your domain name, not mail.yourdoamin.tld.
ah ok.

Ok i relaunch the test win only mydomain.com and got this :

000001.png
The target IP is correct but something looks block it. But as I post above i open all port in the firewall.
This is what i dont get ...
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
823
342
363
cPanel Access Level
DataCenter Provider
It may not really be blocked. cPanel puts a delay on IP's it has not seen before. You can bypass that, but adding the IP to Trusted SMTP IP addresses , but you won't know the IP address of their server.

You can test on your computer with telnet:

Code:
telnet ##.##.##.67 25
And just give it a bit to see if it connects. After a bit, you'll see a couple of 220 replies from the server.
 

caseyj0

Member
Nov 4, 2009
24
2
53
Ohlala ! I find my own mistake !!

0000122.png

I correct it and it works now :D yippeee !
Thanks a lot for help guys.

Khampol.