The MX Record - Resolution of Domains for Email
The addressing of domains on the internet is done by associating a name with its corresponding Top Level Domain (TLD) to an IP address, which a client like a browser retrieves in the form of an A Record from a publicly accessible Domain Name Server (DNS). The Mail eXchange, or MX Record for short, is a separate entry within the records of a DNS that provides an email client with the correct address for delivering an email. This is not a general and possibly distributed across different servers, shared domain, but the specific mail server responsible for this address, e.g. in Hosted Exchange offerings.
What role does the MX Record play in email delivery?
The MX Record has no influence on the content or the direct transmission of messages, but instead serves only to inform clients. It is part of the dataset that, along with other parameters like the A Record and the C Record, belongs to the entry in a DNS. When delivering an email, clients automatically retrieve it from this central database, with the process looking as follows:
- User writes an email and commands to send
- Client sends a request for the MX Record of the domain to the DNS
- DNS sends the MX Record with the mail servers and their priority to the client
- Client extracts the responsible mail server with the highest priority
- Client queries the DNS for the IP of the mail server
- DNS responds with the valid IPv4 and IPv6 addresses
- Client connects to the mail server and authenticates
- Transmission of the unencrypted or encrypted message through TLS/SSL
Therefore, the MX Record is not a protocol like CalDAV for calendar data or HTTP and UDP for transporting information across heterogeneous computer networks. It is simply an information stored in the database of the nameserver that enables the delivery of emails - from love letters to out-of-office replies. With good domain providers, customers can make these entries themselves.
How do global networks use the MX Record?
Until an email reaches its recipient, this process is repeated multiple times. Delivery usually occurs directly in cases of short distances - for example, when using an email domain with its mail server located in the local network. In other cases, a user instead sends their message to the mail server of the used domain - for instance, a free email provider - and uses its MX Record. The mail server stores a copy in the user's account and then checks the MX Record, which provides information about the recipient domain. The assignment to a user - the part before the @ symbol - is done locally and does not affect the delivery.
How is the MX Record structured?
The structure of an MX Record is based on the A Record as well as C Records and follows a fixed standard. It is a concise, structured piece of information that is captured, stored, processed, and distributed in plain text. The MX Record consists of multiple entries, each on a separate line and separated by a line break. It includes three essential pieces of information:
- Domain name, for example, example.org
- Priority of the entry for delivery
- Mail server in the form of a subdomain or a different address
An example of an MX Record looks like this:
example.org preference = 10, mail exchanger = mailserver.example.org
example.org preference = 20, mail exchanger = own.email.domain.co.uk
example.org preference = 30, mail exchanger = mailserver.backup.TLD
The prioritisation in this system is from the lowest to the highest number. In the example above, the client first tries to contact the mail server of example.org. If it fails to reach it or encounters an error during authentication or transmission, it then turns to another - in this case, external - mail server that has its own email domain with a German TLD. If this attempt also fails, in this example, the client then turns to a third server, which may serve as a highly available mail server in security-critical environments.
How to create and modify the MX Record?
The MX Record is part of the name resolution by the DNS and can therefore be configured via the used nameserver, just like the A Record and the C Record. Typically, this is provided directly by the domain provider when registering a domain. All entries are made conveniently through a web interface, which is found in the personal customer area after logging in. An entry or modification only needs to be made once on the lowest - i.e. the mail server responsible for the domain. All instances above it will subsequently adopt this during a regularly scheduled update, which is automated multiple times a day.
Photo: Daria Nepriakhina from Pixabay
Write a comment
More web hosts
More interesting articles
What is a Mail Server - its tasks
The mail server is indispensable in communication. We show you its tasks.
What is Horde Webmail and what are the benefits?
We show you what Horde Webmail is and whether you should use it compared to other webmail services.