My configuration is Ubuntu 16.04 LTS + postfix for basic Internet mail server. We are using Cloudflare as our DDOS protector for websites. Here is the problem:

The website record A example.com working with CF and resolves as not our real IP 164.251.x.x

We have another VPS instance with Mail server and IP of 121.14.x.x. As CF declare it will not work with other ports than 443/80 so the real IP exposes to the world.

Records for mail server: A > mail > 121.14.x.x

MX example.com > mail.example.com > Priority 1. And it works great. We get the emails to:

info@mail.example.com but not info@example.com If we specify MX record to example.com it will resolves as CF IP and forward that mail to website. I hope you get the idea. Here is the tutorial from CF:


How to achieve the mail server to work with to: info@example.com ?

Any help appreciated.


The problem was found. CF has nothing to do with resolving. The root cause was wrong postfix configuration. Make sure hostname matches to example.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.