Junior
What is the purpose of an MX record in DNS?
sobes.tech AI
Answer from AI
An MX record (Mail Exchanger) in DNS indicates to mail servers where to deliver email for a specific domain. It contains the domain name of the mail server and a priority.
Example:
# Record for domain example.com
# PRIORITY | HOSTNAME
10 mail.example.com.
20 backupmail.example.com.
Mail servers sending mail for @example.com will first attempt to deliver it to mail.example.com (priority 10). If this is unavailable, they will try backupmail.example.com (priority 20). A lower numerical value indicates a higher priority.
Thus, an MX record provides:
- Email delivery: Routes incoming mail to the appropriate mail servers.
- Redundancy: Allows specifying multiple servers with different priorities in case the primary is unavailable.
- Load distribution: In some configurations, it can be used to distribute traffic among multiple servers with the same priority.