What are MX records?

MX (Mail Exchange) records are a type of DNS record that specify the mail servers responsible for accepting email messages for a domain. They are used by the Simple Mail Transfer Protocol (SMTP) to route email messages to the correct mail servers for a given domain.

Each MX record specifies a hostname and a priority value. The priority value determines the order in which mail servers should be tried if one is unavailable. The MX record with the lowest priority value is tried first, and if it is not available, the next one with a higher priority value is tried, and so on.

For example, if you have an email service for your domain "example.com", you might have two mail servers, "mail1.example.com" and "mail2.example.com". You would create MX records for "example.com" that specify these two mail servers and their priorities. If "mail1.example.com" is unavailable, email messages for "example.com" will be delivered to "mail2.example.com".