3

I finally got postfix up and running for the first time, and want to make sure all things are correct before I 'test' it out, so I can assume unworldly powers stopped it from working and not me.

Assume my FQDN is me.mysite.com, should my MX record point there or to mysite.com?

John R.
  • 149
  • 3
  • 13

1 Answers1

9

Firstly - your MX record MUST point to hostname that itself points to an A and/or AAAA record. An MX record cannot directly contain an IP address nor can it point to a CNAME record.

Secondly, ideally it should point to whatever your HELO name of the server is, but if they're not going to match nomatter what, then it doesn't matter where it points to, just as long as the A record resolves to the correct IP address.

You can verify your MX is set up correctly by using nslookup (windows) or dig (linux). On nslookup you would do this:

C:\Users\mark.henderson>nslookup
Default Server:  dns.domain.local
Address:  192.168.161.2

> set q=mx
> example.com
Server:  dns.domain.local
Address:  192.168.161.2

Non-authoritative answer:
example.com     MX preference = 10, mail exchanger = mail.example.com

mail.example.com       internet address = aaa.bbb.ccc.ddd

If you see your correct IP address on that last line, then your MX is working correctly.

Alnitak
  • 20,901
  • 3
  • 48
  • 81
Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
  • I am a bit confused, my DNS manager can only provide these options for making an MX record.. "Mail Server: mail.mydomain.com, prio: 10, subdomain: (blank)" .. should subdomain be my FQDN? I got an A record from mail.mydomain.com to mydomain.com, but I am not sure what I should set up for MX regarding subdomain if that is needed.. – John R. Dec 09 '10 at 05:17
  • @John - I don't know what your manager is doing, but if it's got server as `mail.mydomain.com` and you have an `A` record for `mail.mydomian.com` then you should be fine. You can test this by using `nslookup` or `dig`. I'll update my answer with how you can verify this. – Mark Henderson Dec 09 '10 at 05:21
  • Uh oh.. My site's IP is 74.xxx but it says mail.mysite.com is 174.xxx (which points to my nameservers, ns1.linode.com), do I need to set up the subdomain portion of the MX record to fix this? – John R. Dec 09 '10 at 05:38
  • Oh I am an idiot I think.. with my A record I am pointing to DNS not my IP address, I must had copied my DNS and used it in each record forgetting it is not my site's! Let me try that.. Thanks for your help, I understand more about the process :) – John R. Dec 09 '10 at 05:49