大网数据广告活动
服务器运维问答

Two mx records for two different mail servers in the same domain?

· 52CE 我爱测

I have a domain named example.com . I want to set two mail servers on this domain. The main purpose to set these mail servers is to have two different mail server, as if we have two different domains => so it is not one main serv…

问题原文

原帖链接 · meksof · CC BY-SA 3.0

I have a domain named example.com. I want to set two mail servers on this domain. The main purpose to set these mail servers is to have two different mail server, as if we have two different domains => so it is not one main server and the other one for backup.

An MX record for domain example.com is already existing (all mails sent to [email omitted] are delivered to smtp.example.com), so we have

@   3600    IN  MX  1   smtp.example.com

The A records are set like this:

@   600 IN  A   12.12.12.12
smtp    3600    IN  A   13.13.13.13
relay   3600    IN  A   14.14.14.14</pre>

Can we add new MX records for the second mail server?

For example, we set up a new subdomain relay.example.com that points to our new mail server (at ip 14.14.14.14). So that all mail that are sent to [email omitted] will be sent to relay.example.com.

已采纳解答

原帖链接 · Nils Toedtmann · CC BY-SA 3.0

This should do it:

@     3600 IN A    12.12.12.12    ; irrelevant for mail routing

@     3600 IN MX 1 smtp.example.com.
smtp  3600 IN A    13.13.13.13

relay 3600 IN MX 1 relay.example.com.
relay 3600 IN A    14.14.14.14

Notes:

  • The last MX record is not strictly required (according to the standards, if there is no MX record for a domain then its A record is tried as a fallback - but some MTAs might not like that)
  • Don't forget the terminating dot at then end of fully qualified records in your zonefile!

To avoid confusion, here a clarifying variant that would send all mail targeted at @subdom.example.com to the MTA relay.example.com:

subdom 3600 IN MX 1 relay.example.com.
relay  3600 IN A    14.14.14.14

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-09-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。