Понедельник, 29.04.2024, 12:39
Приветствую Вас Гость | RSS
Мой сайт
Главная
Регистрация
Вход
Форма входа

Меню сайта

Категории раздела
Об ОС Windows [137]
В категории размещаются статьи, касающщиеся операционных систем от Microsoft.
Об ОС *Nix [198]
В данной категории собраны статьи об ОС семейства Unix/Linux/FreeBSD/...
Справочные материалы [351]
Справка по всему разделу.
Виртуализация и Облака [46]
Networks & Routing [86]
DataBases [22]

Наш опрос
Оцените мой сайт
Всего ответов: 209

Статистика

Онлайн всего: 1
Гостей: 1
Пользователей: 0

Главная » Статьи » Системное администрирование » Об ОС *Nix

Bind. Mail Exchange Record (MX)

Mail Exchange Record (MX)

Defined in RFC 1035. Specifies the name and relative preference of mail servers (mail exchangers in the DNS jargon) for the zone. The MX RR is used by SMTP (Mail) Agents to route mail for the domain.

Format

name ttl class rr pref name
example.com. IN MX 10 mail.example.com.

The pref (Preference) field is relative to any other MX record for the zone (value 0 to 65535). Low values are more preferred. The pref value 10 you see all over the place is just a convention you can use any number(s) you wish. The pref field is used by the SMTP (Mail) Agent to select the most preferred (lowest pref) mail server. If this mail server is unavailable (down or too busy) then if a lower preference mail server is defined (has a higher pref value) it is tried. When all defined mail servers have been tried the mail agent will then fall back to its error recovery strategy - typically an increasing time back-off algorithm over a period of 24 to 48 hours.

Any number of MX records may be defined. If the mail server lies within the domain it requires an A record. MX records do not need to point to a host in this zone. MX records should not point to CNAME RRs (but frequently do, see the discussion on this topic). Defining MX records for subdomains.

The sending SMTP Agent, for example sendmail or postfix, will query the DNS for an MX RR based on the format of the mail address. Thus if the mail address is user@example.com the mail agent will issue an MX query for example.com whereas if the mail address is user@subdomain.example.com it will issue an MX query for subdomain.example.com.

Note: Mail is normally obtained by users (using POP3 or IMAP) only from the primary (lowest pref) mail server. Back-up mail servers (higher pref values) are usually configured to simply forward mail over a prolonged period (multiple days or even weeks) to the primary mail server.

Examples & Variations

; zone fragment example.com
; mail servers in the same zone
; will support email with addresses of the format 
; user@example.com
$TTL 2d ; zone default = 2 days or 172800 seconds
$ORIGIN example.com.
example.com. IN SOA ns1.example.com. root.example.com. (
 2003080800 ; serial number
 3h ; refresh = 3 hours 
 15M ; update retry = 15 minutes
 3W12h ; expiry = 3 weeks + 12 hours
 2h20M ; minimum = 2 hours + 20 minutes
 )
 IN MX 10 mail ; short form
; the line above is functionally the same as the line below
; example.com. IN MX 10 mail.example.com.
; any number of mail servers may be defined
 IN MX 20 mail2.example.com.
; use an external back-up
 IN MX 30 mail.example.net.
; the local mail server(s) need an A record 
mail IN A 192.168.0.3
mail2 IN A 192.168.0.3

No mail servers in zone:

; zone fragment for example.com
; mail servers not in the zone
; will support email with addresses of the format 
; user@example.com
$TTL 2d ; zone default = 2 days or 172800 seconds
$ORIGIN example.com.
example.com. IN SOA ns1.example.com. root.example.com. (
 2003080800 ; serial number
 3h ; refresh = 3 hours 
 15M ; update retry = 15 minutes
 3W12h ; expiry = 3 weeks + 12 hours
 2h20M ; minimum = 2 hours + 20 minutes
 )
; mail servers not in zone - no A records required
 IN MX 10 mail.foo.com.
 IN MX 20 mail2.foo.com.

Subdomain MX records

You can define subdomains (aka subzones) as being fully delegated (uses a separate zone file) or as what we call virtual (or pseudo) sub-domains (uses a single zone file). The following example uses a virtual subdomain (all the definitions are contained in a single zone file).

; zone fragment for example.com
; name servers in the same zone
$TTL 2d ; zone default = 2 days or 172800 seconds
$ORIGIN example.com.
example.com. IN SOA ns1.example.com. hostmaster.example.com. (
 2003080800 ; serial number
 2h ; refresh = 2 hours 
 15M ; update retry = 15 minutes
 3W12h ; expiry = 3 weeks + 12 hours
 2h20M ; minimum = 2 hours + 20 minutes
 )
; mail server for main domain
; will support email with addresses of the format 
; user@example.com
 IN MX 10 mail.example.com.
; A record for mail server above 
mail IN A 192.168.0.5
; other domain level hosts and services
....
; sub-domain definitions
; will support email with addresses of the format 
; user@us.example.com
$ORIGIN us.example.com.
 IN MX 10 mail
; record above could have been written as
; us.example.com. IN MX 10 mail.us.example.com.
; optional - define the main mail server as backup
 IN MX 20 mail.example.com.
; A record for subdomain mail server
mail IN A 10.10.0.29
; the record above could have been written as 
; mail.us.example.com. A 10.10.0.29 if it's less confusing
....
; other subdomain definitions as required 

An alternate way of defining the above (which we think is confusing) is shown below:

; zone fragment for example.com
; name servers in the same zone
$TTL 2d ; zone default = 2 days or 172800 seconds
$ORIGIN example.com.
example.com. IN SOA ns1.example.com. root.example.com. (
 2003080800 ; serial number
 2h ; refresh = 2 hours 
 15M ; update retry = 15 minutes
 3W12h ; expiry = 3 weeks + 12 hours
 2h20M ; minimum = 2 hours + 20 minutes
 )
; mail server for main domain
; will support email with addresses of the format 
; user@example.com
 IN MX 10 mail.example.com.
; mail server for subdomain 'us'
; will support email with addresses of the format 
; user@us.example.com
us IN MX 10 mail.us.example.com.
us IN MX 20 mail.example.com.
; A record for main mail server above 
mail IN A 192.168.0.5
; other domain level hosts and services
....
; sub-domain definitions
$ORIGIN us.example.com.
; A record for subdomain mail server
mail IN A 10.10.0.29
; the record above could have been written as 
; mail.us.example.com. A 10.10.0.28 if it's less confusing
....
; other subdomain definitions as required 


Источник: http://www.zytrax.com/books/dns/ch8/mx.html
Категория: Об ОС *Nix | Добавил: admin (17.01.2013)
Просмотров: 2042 | Комментарии: 1 | Теги: MX, Bond, mail | Рейтинг: 0.0/0
Всего комментариев: 0
Имя *:
Email *:
Код *:
Поиск

Друзья сайта
  • Официальный блог
  • Сообщество uCoz
  • FAQ по системе
  • Инструкции для uCoz


  • Copyright MyCorp © 2024