How to set up smartphones and PCs. Informational portal
  • home
  • Windows 7, XP
  • What are DNS resource records? Email Service Basics: What is an MX Record.

What are DNS resource records? Email Service Basics: What is an MX Record.

Yandex Mail provides one very useful and, most importantly, free service corporate mail, at which you can connect your domain to Yandex and use mail with the name of your domain and content from Yandex. And this is really convenient, and you can transfer not the entire domain, but only the mail part ( Mail server MX records). That is, the site will work as before, and mail will be transferred to Yandex Mail. And it is this procedure that I will describe in this note.

Since I have it at hand ISPmanager, then I will do this with an emphasis on this hosting management system with all the nuances that will arise while working with the “IP Manager”.

Domain confirmation for Yandex Mail

The first step to mail with the shell of your domain and Yandex filling is to confirm the domain (in my case, when I have a different hosting and other purposes for the site itself).

Nothing complicated here: create a file at the root of the site with the right name and the necessary content and that’s it - the verification is passed, the site is confirmed.

Configuring MX DNS records in ISPmanager (for Yandex.Mail)

But this step is more difficult and requires careful study, since it determines how well and smoothly your mail on Yandex will work and whether it will work at all.

1) Remove the domain from the "E-mail" section -> " Mail domains" (since ISPmanager most likely registers some data in the DNS there and if this is not done, then some letters will not reach the Yandex mail).

2) Now you need add MX records in your site's DNS. You can do this in the "Main" section -> " Domain names" and double-click on the domain with the left button and you will see a list of DNS records for the domain. Our task: remove old MX and add new ones, and you can do it like this:

a) Delete all entries with type MX (mail server) And TXT (text entry).
b) Add a Yandex mail server:

Name: YOUR.DOMAIN. Type: MX (mail server) Address: mx.yandex.ru. Priority: 10


Don't forget about the period after the domain, it is required.
V) Redirect an SPF record by adding another record:

Name: YOUR.DOMAIN. Type: TXT (text record) Address: v=spf1 redirect=_spf.yandex.ru


This is necessary so that “good” letters do not end up in spam.

You should end up with something like this ( True, the domain here is filled with example.test and the addition of both entries is shown in the picture at the same time in order to combine everything in one image, but the essence is the same):


After saving and a couple of clicks in the Yandex panel, the mail will work as it should. And one more nuance: DNS is not updated instantly, so I advise you to wait 10-30 minutes before visiting the Yandex panel.

By the way, this information about setting up Yandex Mail in ISPmanager was provided by one of the main developers of ISP System with the nickname ls and thanks to him for the picture.

Good luck with your email and less spam! =)
Questions, amendments, etc. I'll be glad to see you in the comments.

One of the fundamental principles for building any postal system in modern network– availability and correct setting MX records in DNS. Unfortunately, not all mail administrators thoroughly understand what an MX record is and what its role is in organizing a domain mail system.

DNS Basics

The abbreviation MX stands for “mail exchanger”. An MX record is one of the types of DNS records, so in order to understand what an MX record is, you need to understand the basics of architecture and operation DNS services(Domain Name System).

Most important function DNS services – converting domain names to IP addresses. For example, if you type www.microsoft.com in the address bar of your browser, the DNS service allows you to determine the IP address of the server with which you need to establish a connection. In this example, the domain name is microsoft.com.

What happens if you try to send postal message to the address [email protected]?

And in this case, to determine the mail server, we need to use the functions of the DNS service. The server sending mail looks up the DNS MX record of the receiving mail server using the following algorithm:

  1. Determining an authoritative name server (NS or name server) for the microsoft.com domain
  2. Query the microsoft.com domain nameserver to get all MX records
  3. Resolving MX record server names to their IP addresses

If you want to manually define MX records for the microsoft.com domain, the procedure would look like this:
C:\> nslookup
Default Server: UnKnown
Address: 10.0.1.9

> set type=mx
> microsoft.com
Server: Unknown
Address: 10.10.21.19

Non-authoritative answer:
microsoft.com MX preference = 10, mail exchanger = mail.messaging.microsoft.com

mail.messaging.microsoft.com internet address = 216.32.181.178
So, we found out that the IP address " postal exchanger» for the domain for microsoft.com -216.32.181.178.

MX Preferences

Another nuance of operation postal service– the ability to set the priority of the mail server, this technology is called “MX preference”. To understand what MX preference is, let's take a look at the DNS and MX records of the google.com domain.
> google.com
Server: Unknown
Address: 10.10.21.19

Non-authoritative answer:
google.com MX preference = 10, mail exchanger = aspmx.l.google.com
google.com MX preference = 20, mail exchanger = alt1.aspmx.l.google.com
google.com MX preference = 30, mail exchanger = alt2.aspmx.l.google.com
google.com MX preference = 40, mail exchanger = alt3.aspmx.l.google.com
google.com MX preference = 50, mail exchanger = alt4.aspmx.l.google.com

aspmx.l.google.com internet address = 74.125.39.27
alt1.aspmx.l.google.com internet address = 209.85.173.27
alt2.aspmx.l.google.com internet address = 74.125.127.27
alt3.aspmx.l.google.com internet address = 209.85.225.26
alt4.aspmx.l.google.com internet address = 74.125.65.26

As you can see, there are 5 different MX records for the google.com domain (five mail servers) With different meaning preference parameter. The preference parameter allows you to set the priority of each MX record, i.e. determines the sequence in which attempts to deliver a letter will be made to these servers. A lower value corresponds to a higher priority, i.e. It is to this mail server that letters will be sent first.

Multiple MX records are needed for:

  • Possibility of organizing load balancing between receiving mail servers, for which it is necessary to create several MX records with the same priority
  • Organization of fault tolerance of the mail system, which determines the procedure for determining the next receiving mail server if primary server(with a minimum MX preference value) is not available.

A mail server located on another site is usually set as a backup server, usually for the purpose of economy, which usually has a lower throughput communication channels and computing power. And, without a doubt, it is much better when a letter, if one of the servers is unavailable, is still sent to backup server, and does not remain in the queue on the sending side, and which after some time makes repeated attempts to send (retry).

What should MX records point to?

Now that we've figured out what MX records are for, let's try to understand what these records should point to.

If your organization contains and supports postal system independently (receives mail directly), then the MX record of your domain should point to the external IP address of your firewall(if NAT/PAT address/port translation technology is used) or the external address of your mail server (for example, it could be a server with the Edge Transport role, or a Linux-based mail MTA).

If your company uses some external “cloud” service to filter mail, then the MX records of your domain should point to the IP address specified by the provider of this service.

These are the two most common examples found on this moment, however, there are a number of other scenarios: geo-distributed networks, hybrid cloud-physical networks, etc.

That's all! In this article, we briefly introduced the concept of an MX record and why it is needed, I hope it will be useful for novice mail administrators.

DNS (Domain Name System) is the “phone book” of the Internet. It uses an IP address as a phone number, and domains as contact names. In such a book you can add not only “ phone number", but also Additional information about the contact (“e-mail”, “place of work”, etc.).

Domain information is stored on DNS servers. To add it to DNS system, you need to register resource records. With their help, servers share information about domains with other servers. Until resource records for the domain are registered, it is not in the “ phone book» Internet. Therefore, the operation of the site or mail on it is impossible. Before you start specifying resource records, you need to delegate the domain, that is, register DNS servers for it. You can do this according to the instructions: . Then move on to resource records. The changes will take effect after the DNS servers are updated (usually within 24 hours).

Basic resource records: A, CNAME, MX, TXT and SPF records. Let's take a closer look at them.

Record A

The A (address) record is one of the key resource records of the Internet. It is needed to connect the domain with the server IP address. Until the A-record is registered, your site will not work.
When you enter the site name in address bar browser, exactly DNS A records determines which server your site should be opened from.

Examples of A record:

Entry nameRecord typeMeaning
site.ruA123.123.123.123
shop.site.ruA123.123.123.123

You can register an A-record according to the instructions:

CNAME record

CNAME (Canonical name) is a record that is responsible for linking subdomains (for example, www.site.ru) to the canonical domain name (site.ru) or another domain.
The main function of CNAME is duplication of domain resource records (A, MX, TXT) for different subdomains.

Examples of CNAME records:

Entry nameRecord typeMeaning
www.site.ruCNAMEsite.ru
webmail.site.ruCNAMEwebmail.hosting.site

If you enter a CNAME for a subdomain www.site.ru and specify the value site.ru, the site will open from the same IP address as site.ru. If you enter CNAME for mail.site.ru and indicate the value webmail.hosting.site, then on mail.hosting.site The same resource records will be distributed as for webmail.hosting.site.

The use of a CNAME record precludes the use of other resource records for a given subdomain, i.e., for a subdomain webmail.site.ru or www.site.ru You cannot add both an A record and a CNAME record at the same time.

You can register a CNAME record according to the instructions:

MX Record

MX (Mail Exchanger) is a record responsible for the server through which mail will work. MX records are critical to mail functionality. Thanks to them, the sending party “understands” which server to send mail for your domain.

MX record examples:

Entry nameRecord typeA priorityMeaning
site.ruMX10 mx1.hosting.site
site.ruMX15 mx2.hosting.site

where mx1.hosting..

Typically, two mail servers are specified so that if one of them is unavailable, mail will still be sent to the other. Write priority determines which server mail should be sent to first. The lower the number, the higher the priority. Thus, for the domain name site.ru, the mail server is mx1.hosting..hosting.. If the priority is the same, the server is selected randomly.

You can register an MX record according to the instructions:

TXT entry

TXT (Text string) - a record that is used to set the necessary text comments for the domain. Often used to check domain ownership when connecting additional services, and also as a container for an SPF record and a DKIM key. You can register an unlimited number of TXT records, as long as they do not conflict with each other.

You can register a TXT record according to the instructions:

Record SPF

An SPF (Sender Policy Framework) record contains information about the list of servers that have the right to send letters on behalf of a given domain. Helps avoid unauthorized use. The SPF setting is specified in the TXT record for the domain.

Example of an SPF entry:

Entry nameRecord typeMeaning
site.ruTXTv=spf1 include:_spf.hosting..123.123.123 a mx ~all

where 123.123.123.123 is the IP address of the server you need.

In this example:

  • v=spf1— determines the version of the SPF record used;
  • include:_spf.hosting.site— includes in the SPF record the value of the SPF record of another domain. That is, all SPF record values ​​for the domain “_spf.hosting.site” will be valid for the domain;
  • ip4: 123.123.123.123 - allows receiving mail from IP address 123.123.123.123;
  • a— allows receiving mail from a server whose IP address is in resource A record domain. Simply put, from the server where the site is hosted;
  • mx— allows receiving mail if the sending server is specified in one of the MX records for the domain;
  • ~all— if the letter came from a server that is not included in the above list, it is worth analyzing it more carefully. Also sometimes used -all- in this case the letter does not go through additional checks and is immediately rejected.

You can register an SPF record according to the instructions:

NS, PTR, SOA records are service records and, as a rule, are configured automatically.

NS entry

NS record (Authoritative name server) points to DNS servers that are responsible for storing the remaining resource records of the domain. The number of NS records must strictly correspond to the number of all servers serving it. Critical to the operation of the DNS service.

PTR Record

PTR is a reverse DNS record that associates a server's IP address with its canonical name (domain). The PTR record is used to filter mail. If you have ordered a VPS or Dedicated server, you can register a PTR record according to the instructions:

SOA Record

SOA (Start of Authority) is the initial zone record that indicates on which server the domain name reference information is stored. Critical to the operation of the DNS service. You can find out more about what an SOA record is and how to check it.

MX Record

MX record(from English m ail e x changer ) is a type of record in DNS that specifies how email is routed. MX records for a given domain indicate the servers to which to send email, intended for addresses in this domain. In addition, MX records indicate the priority of each possible servers for sending.

The host name specified in the MX record must contain the IP address defined by the IN A record. IN CNAME aliases cannot have their own MX records.

To send email to a specific address, the sending server makes a DNS query, asking for the MX record of the recipient's domain email(that is, the part of the address after the “@” symbol). As a result of the request, a list of host names of mail servers that accept incoming mail for a given domain is returned, as well as the priority value for each host. The sending server then tries to establish an SMTP connection with one of these hosts, starting with the one with the lowest priority value, trying each of them until a connection can be established with at least one of them. If there are several hosts with the same priorities, then attempts must be made to establish a connection with each of them.

The MX records mechanism provides the ability to use multiple servers for a single domain and streamline their use to reduce load and increase the likelihood of successful mail delivery. In addition, such a mechanism provides the ability to distribute incoming mail processing among several physical servers.

Features of MX processing when routing mail

Several mail servers with different priorities can be specified for one domain. If for some reason mail is delivered to a node with a relatively low priority (i.e. a large number in the MX record), then this node, when deciding on routing (relaying) to the recipient node (to any of the nodes with highest priority), ignores its MX record and MX records with a priority lower than its own. For correct exception itself from the list of addresses for mail delivery, only canonical names should be specified in MX records. When incorrect settings loops are possible (when the server tries to deliver mail to itself).

MX Record Request Examples

Using the host utility on UNIX-like OSes

Using the host utility in GNU/Linux, FreeBSD, etc., we will request an MX record for the wikipedia.org domain.

$ host -t mx wikipedia.org. wikipedia.org mail is handled by 50 lists.wikimedia.org. wikipedia.org mail is handled by 10 mchenry.wikimedia.org.

Here the list of mail servers serving domain mail is represented by two hosts: lists.wikimedia.org. and mchenry.wikimedia.org. Their MX priorities are 50 and 10, respectively. Thus, when trying to deliver mail to a recipient in the wikipedia.org domain. , the first server selected will be mchenry.wikimedia.org.

Using the nslookup utility

Using the nslookup utility in the Microsoft Windows family of operating systems, we will request the MX record for the wikipedia.org domain.

C:\>nslookup -type=mx wikipedia.org ns2.wikimedia.org Server: ns2.wikimedia.org Address: 91.198.174.4 wikipedia.org MX preference = 50, mail exchanger = lists.wikimedia.org wikipedia.org MX preference = 10, mail exchanger = mchenry.wikimedia.org lists.wikimedia.org internet address = 91.198.174.5 mchenry.wikimedia.org internet address = 208.80.152.186

Note: nslookup works in much the same way on UNIX.

see also

  • DNS - domain name system;
  • SMTP is a widely used mail transfer protocol.

Wikimedia Foundation. 2010.

See what an “MX Record” is in other dictionaries:

    In the field of copyright, the recording of sounds and/or images by technical means in any material form that allows for their repeated perception, reproduction or communication. See also: Works Financial... ... Financial Dictionary

    RECORD, records, women. 1. units only Action under Ch. write down (in 1 and 2 digits) write down (book). Writing down fairy tales took me a whole summer. Pre-registration for loan bonds. 2. What is written down (in 1 value; book). Notebook with notes. 3.… … Dictionary Ushakova

    recording- RECORDING, arch., history. 1. Recording, written delivery what l. seen, heard (1055); 2. Document, record of which letter. legal act (XV century) (Sl.RYA XI XVII. 5. 266 267). Single entry. – Peace (author's note). - I don’t know how to end it... ... Dictionary of the trilogy “The Sovereign's Estate”

    recording- Document containing results achieved or evidence of activities performed. Notes 1. Records may be used, for example, to document traceability and evidence of verification, preventive actions... Technical Translator's Guide

    - (record) A collection/complex of interrelated information that is considered as a single whole in a file (file) or database (database) of a computer. For example, a file about wages company personnel can be divided into individual entries… … Dictionary of business terms

    RECORDING, storing audio and video signals on media such as a gramophone record or MAGNETIC TAPE. In traditional SOUND RECORDING, the recorded sounds are converted into electricity, which controls the movements of the writing needle. She cuts through the primary... ... Scientific and technical encyclopedic dictionary

    Scripture, mark; registration, protocol, accounting; rewriting, copy; note, score, plywood, litter, note, equation, phonogram, synopsis, transcript, transcription, update Dictionary of Russian synonyms. entry noun, number of synonyms: 47... ... Synonym dictionary

    Written recording of operations, transactions, accounting entries, changes in accounts. Raizberg B.A., Lozovsky L.Sh., Starodubtseva E.B.. Modern economic dictionary. 2nd ed., rev. M.: INFRA M. 479 p.. 1999 ... Economic dictionary

    RECORD, and, female. 1. see write down. 2. What is written down. Illegible h. Notebook with notes. Musical recordings. 3. Document about what no. transaction, act (special). Gift deed Ozhegov's explanatory dictionary. S.I. Ozhegov, N.Yu. Shvedova. 1949 1992 … Ozhegov's Explanatory Dictionary

    Record- in paperless computer science, a set of data characterizing a particular object or phenomenon: for example, an employee’s personnel profile or a picking list for a machine part entered into the computer’s memory. When contacting... ... Economic and mathematical dictionary

    Record- according to the law of the Russian Federation On motor vehicles. law and related rights, fixation of sounds and (or) images using technology. funds in k.l. a material form that allows these sounds and (or) images to be repeatedly perceived and reproduced (see Reproduction... ... Publishing dictionary-reference book

Books

  • Recording audio and video signals, E. I. Vologdin, K. F. Glasman, Yu. A. Kovalgin, L. G. Lishin. Analog magnetic recording of audio and video signals is considered; the main content of the book is devoted to digital recording. The features of digital representation of audio and video signals are outlined...

The MX record points to the server that accepts mail for your domain. In order for your mail to be processed by the Yandex server, you need to create an MX record pointing to it.

If you want the Yandex server to serve postal addresses that you used before setting up the MX record, create the same addresses for the desired domain. You can also import mailboxes along with letters.

If you have delegated the domain to Yandex servers, the MX signature will be configured automatically. You can view and edit its settings in the DNS editor of Mail for a domain.

    Log into your control panel on the website of the company providing your DNS hosting services.

    Remove existing MX records.

    Create a new MX record with the following field values ​​(in different panels field names may differ):

    • The value is “mx.yandex.net.” .

      The period at the end of the server name is required. In some control panels, the point is taken into account by default, then you do not need to specify it.

      Priority - 10.

      If priority value "10" is not provided in the control panel, specify any other priority other than zero.

      The subdomain name is "@".

      Some control panels require you to enter your domain name instead of "@" (for example, "yourdomain.tld."). If you can't specify either "@" or a domain name, leave this field blank.

      If this field is not present in the control panel, you can omit it.

    Wait for the DNS changes to take effect. This process can take up to 72 hours.

Best articles on the topic