Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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

share|improve this answer
    
Thanks... This destroys what I have understood about DNS configuration but I am glad that my gut feelings where actually correct... I know I should have actually tested the thing, but hey, since I could ask... –  user56381 Oct 7 '10 at 12:28

Most daemons allow themselves to be configured to bind to specific addresses; investigate their documentation for how.

share|improve this answer
    
I know how to bind the services I run to specific addresses... my problem was with the DNS configuration itself. I never had to do anything like this with DNS up until now and docs on DNS setup are not so clear cut (at least for me, I might be particularly thick) –  user56381 Oct 7 '10 at 12:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.