web server + separate mail server = same domain name possible?

April 12, 2015 1.7k views
DNS Email LEMP Ubuntu

My situation:

  1. one web server for my public website (mydomain.org)
  2. one mail server for my website (mail.mydomain.org)

My goal:
Emails on mail server look like this: user@myname.org (not user@mail.myname.org)

Is this possible?

2 Answers


You have to add a MX record to the DNS for "mydomain.org". The MX record points to "mail.mydomain.org". When mail servers resolve "user@mydomain.org" they will query the MX record for "mydomain.org" and get told to fetch email from "mail.mydomain.org". That DNS can point to any IP you want to use as your email server.

Have another answer? Share your knowledge.