“relay access denied” after changing domain A record

domain-name-systememailmx-record

I'm experiencing issues with email, specificially "Relay Access Denied" errors after changing my A record for my apps domain name. It was previously setup like:

  • Host a
    • manages dns (mydomain.com in A record 123.456.789.122)
    • manages email
    • serves app

Now I have it so that:

  • Host a
    • manages dns (mydomain.com in A record 99.999.999.999)
    • manages email (or at least I want it to)
  • Host b (IP 99.999.999.999)
    • serves app

So all I did was go into my dns settings and changed the A record to Host b. At this point my mail stopped working, yielding a "Relay Access Denied" to anyone that sends mail to foo@mydomain.com. The MX record on Host a looks like:

mydomain.com. in MX 0 mydomain.com

I'm assuming that since I changed the A record for mydomain.com it's trying to manage email on Host b? Do I need to modify my MX Record for the domain to point to an A record that is on Host a? Sorry to be confusing, just want to have host a manage email, and host b just serve the site. Thanks for any guidance!

Best Answer

The MX record needs to point to a name that resolves to the correct host.

When handling your own mail, it's common to use a name dedicated this purpose which indicates the role and which can be updated separately from any other names in use, such as mail.example.com. If that approach does not strike your fancy I would suggest going with the canonical name of the host that handles mail, eg zeus.example.com.

Related Topic