MX record
MXAn MX record tells other mail servers where to deliver email for your domain, and in what order to try.
What an MX record does
An MX record pairs a hostname with a priority number. A sending server looks up the MX records for the recipient domain and connects to the hosts it finds, lowest priority number first.
MX records must point at hostnames, not at IP addresses. The named host then needs its own A or AAAA record for delivery to work.
How priority works
Lower numbers are tried first. A domain publishing priority 10 and priority 20 hosts will receive mail at the 10 while it is reachable, and only fall back to the 20 when it is not.
Records may share a priority. Sending servers distribute across equal-priority hosts, which is how providers spread inbound mail across several servers.
The numbers themselves have no meaning beyond their relative order. Using 10 and 20 rather than 1 and 2 is only a convention that leaves room to insert a host between them later.
What goes wrong
No MX records at all means the domain is not configured to receive mail. Some senders fall back to the domain's A record, but this behaviour should not be relied on.
An MX pointing at a hostname with no address record causes delivery failures, as does an MX pointing at an IP address rather than a name.
Publishing MX records does not authorise anything to send mail as your domain. That is what SPF, DKIM and DMARC do.
