Pointing an MX record to an IP address

An MX record (mail exchanger record) in DNS can only point to a hostname, not directly to an IP address. If you need mail for your domain to be delivered to a specific server identified by its IP, you need a small workaround using two DNS records (zone entries).

How to point mail to an IP address

  1. Create a hostname (subdomain, e.g. mail.example.com) with an A record pointing to your IP address.
  2. Create an MX record for your domain that points to that hostname.

With this setup the MX record points to a valid hostname, and the hostname resolves to your chosen IP address.

Was this article helpful?

Related Articles