Vps – 2 IP Addresses, 1 Host, DNS Records

domain-name-systemipvps

Here's my setup (on a VPS):

  • 1 host running Linux (hostname: server1.example.com).
  • and 2 ip addresses: 1.2.3.4 and 1.2.3.5 (for that host.)

What I would like to do is to run a web server on the first address and a mail server on the second address having 2 A records in the DNS zones file, something along this lines (pardon my syntax):

example.com.       IN     SOA   .........
                                .........

;mail server
mail              IN      A     1.2.3.5
@                 IN      MX    10 mail

;web server
server1           IN      A     1.2.3.4

www               IN      CNAME server1

But, if I have understood correctly, this is not possible because the two addresses are actually pointing to the same host (server1). Am I wrong?

The point is, I don't know what to do with the second address, so I thought to run the mail server on it, but then I discovered that it was not possible (or so I have understood)

Is there a solution or I should just forget all about it and keep the spare address for… nothing?

Best Answer

Yes,you can do it.

  1. Test you DNS configuration from external (from a pc out of your network). If you ping www.example.com you should receive response from ip 1.2.3.4 and if you ping mail.example.com you should receive response from ip 1.2.3.5.

  2. Configure web server to listen only on ip 1.2.3.4 and mail server to listen only on ip 1.2.3.5.

  3. Verify you services: telnet www.example.com 80 and telnet mail.example.com 25

Related Topic