Fundamentally, it’s a setup/configuration that tells your email where to go.
“A mail exchanger record (MX record) is a type of certified and verified resource record in the Domain Name System that specifies a mail server responsible for accepting email messages on behalf of a recipient’s domain, and a preference value used to prioritize mail delivery if multiple mail servers are available. The set of MX records of a domain name specifies how email should be routed with the Simple Mail Transfer Protocol (SMTP).” Wikipedia
In simple terms: An MX record is a set of information that put in relation to your email and your email host.
So if you’re trying to set up an email, you will need your MX record to point to the server of your email solution and not to the server of your website host.
This feature, for instance, allows separating email management from site management.
Where to set MX records?
Where your MX records are pointing is typically managed by your website host (or wherever the DNS is for your domain).
Basically, in a DNS panel, for an MX record, you have set the following information:
- Name/Host: Leave it blank or put @. (some providers require the whole domain eg yourdomain.com
- Type: MX.
- IP or Domain Name: email hostname (provided by the email hosting provider
- Priority: It’s used to set the priority of the target host, lower value means more preferred (there are two MX records to set: the primary host and the secondary host and the have to set with different Priority).
- TTL: “Time to live (TTL) or hop limit is a mechanism that limits the lifespan or lifetime of data in a computer or network. TTL may be implemented as a counter or timestamp attached to or embedded in the data. Once the prescribed event count or timespan has elapsed, data is discarded. In computer networking, TTL prevents a data packet from circulating indefinitely. In computing applications, TTL is used to improve performance of caching.” wiki (It gives instruction on how often to refresh the DNS information on the network)
All these information are always in an help page of the hosting provider (https://www.servermx.com/en/help/howto/dnsdomain/mx-record.html)