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

DNS Configuration for Web Server and Mail Server

· 52CE 我爱测

I am new to computer networking. I have successfully added MX record of email service provider (Yandex), and it works finely. Also I added A record pointing to the Web Server which installed on VPS. Now I want to redirect all mai…

问题原文

原帖链接 · Kolitha Nilame · CC BY-SA 4.0

I am new to computer networking.

I have successfully added MX record of email service provider (Yandex), and it works finely. Also I added A record pointing to the Web Server which installed on VPS.

Now I want to redirect all mail to a Mail Server running on a different VPS (with Zimbra open source edition installed).

How could I do it using DNS Records?

已采纳解答

原帖链接 · HBruijn · CC BY-SA 4.0

For your scenario you typically end up with 4-6 DNS records.

  • Two A or AAAA resource records that point to the IPV4 (for instance 192.0.2.1) resp. IPv6 (for instance 2001:db8:10::1) ip-address of your webserver that will be accessible for visitors using the bare and www versions of your domain i.e. https://example.com and http://www.example.com.
  • One A or AAAA resource record that poinst to the IPV4 (for instance 192.0.2.2) resp. IPv6 (for instance 2001:db8:10::2) of your mail server, for instance an aptly named mail.example.com. That will also be the server name your mail users need to configue in their e-mail clients.
  • One MX records that instructs mail servers to deliver messages with e-mail addresses using the domain suffix @example.com. to your mail server.

Everything after the ; is a comment by the way and should be omitted when you create your own DNS records:

example.com.       IN  A     192.0.2.1         ; IPv4 address for the bare domain
example.com.       IN  AAAA  2001:db8:10::1    ; IPv6 address for the bare domain
www.example.com.   IN  A     192.0.2.1         ; IPv4 address for www
www.example.com.   IN  AAAA  2001:db8:10::1    ; IPv6 address for www
mail.example.com.  IN  A     192.0.2.2         ; IPv4 address for mail
mail.example.com.  IN  AAAA  2001:db8:10::2    ; IPv6 address for mail
example.com.       IN  MX 1  mail.example.com. ; Direct SMTP e-mail to mail.example.com.

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

资料来源与适用范围

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

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

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