2

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?

Sergey Nudnov
  • 833
  • 6
  • 12

1 Answers1

1

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.
HBruijn
  • 72,524
  • 21
  • 127
  • 192