I have a VPS with three IPs. They're all on completely unrelated IPs (one is 23.226.xxx.x, another is 107.161.xx.xx, a third is 167.88.xxx.xx).

If I go to beta.mydomain.com (for example, that won't actually be the subdomain), I want it to go to 23.226.xxx.x. Going to mydomain.com would just go to 107.161.xx.xx, and going to somethingelse.mydomain.com would go to 167.88.xxx.xx.

Is this possible?

  • One-word answers are somewhat discouraged here and I don't think you would find "Yes" to be very helpful. Could you add to your question what you have tried already and what problems you ran into? – Ladadadada Apr 4 '14 at 0:36
  • @Ladadadada I'm not asking if I can do it, I'm asking how. Does that fix it or is it still against the rules? – user215103 Apr 4 '14 at 0:40

You just need to create 3 different A records in your DNS service pointing the domain or subdomains to the different ip addresses and then in apache create 3 different virtual hosts (one per domain/subdomain) bound each to its respective ip.

A reason to do this would be to use https, otherwise it's not needed in general since you can serve multiple domains and subdomains from the same ip address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.