The DNS record type used for email servers to identify where incoming emails should be sent is called the Mail Exchange (MX) record. MX records specify the mail servers responsible for accepting email messages for a particular domain.
When an email is sent, the sender's mail server queries the DNS system for the MX records of the recipient's domain. The MX records contain information about the mail servers that can receive email for that domain. The sender's mail server then delivers the email to one of the designated mail servers based on the priority (preference) specified in the MX records.
Each MX record consists of a preference value and a mail server hostname. The preference value indicates the order in which mail servers should be contacted. Lower preference values are prioritized over higher ones. If there are multiple MX records with the same preference value, the sending server will randomly select one from the available options.
Here's an example of an MX record:
example.com. IN MX 10 mail.example.com.
In this example, "example.com" is the domain, "10" is the preference value, and "mail.example.com" is the hostname of the mail server responsible for handling incoming emails for the domain.
By using MX records, the DNS system helps direct incoming email traffic to the appropriate mail servers, ensuring the reliable delivery of messages within the email infrastructure.