many ip for 1 website

April 29, 2014 1.4k views
Hello, After many hours thinking and chatting with my brother I decided to move my website from shared hosting to Digital Ocean. I have experience setting up my website but I was wondering, is it possible to host 1 mail server and 1 web server with different ip but both point to my domain mane? For example I want webmail.mydomain.com to point only to the mail server and blog.mydomain.com to point to my web server. How can I do this? Also I am thinking to use nginx and Debian, is it ok? What is your opinion?
4 Answers
Yes this is possible. Just set two different A records with your DNS host for both subdomains.
Yes, that's definitely possible.
Here's what you need to do:
  1. Add an A record called '@' with the value of your droplet's IP address
  2. Add an A record called 'mail' with the value of your 1and1 mail server's IP address
  3. Add an MX record called '@' with the value of 'mail' and the priority of 10

If any of the records above already exist, just remove the old ones. If you're not sure what your mail server's IP address, please post the actual domain.
Thank you both, just one more stupid question. Do I have to do any special configuration with nginx?
No, it should work just fine without any special config. Let me know how it goes! :]
Have another answer? Share your knowledge.