Actually, a CNAME won't do this. You need an A record for each host.
CNAME records are used to point one domain to another domain name, as opposed to an IP address.
Technically, these are not "subdomains", but simply multiple hosts. It's only a subdomain if there are multiple hosts under a subdomain name.
Are three hosts in the example.com domain.
us.example.com and corporate.example.com are subdomains. www.us.example.com, www2.us.example.com, blog.us.example.com are hosts in the us.example.com subdomain.
Each of the hosts listed above would need an A record, pointing to the IP addresses of each host.
A CNAME is used when you want to create an "alias" for a host. For example, you have www.example.com, and, for whatever reason, you ALSO want to refer to the same host as foo.example.com. Or www.example2.com. You can use either an A record or a CNAME to accomplish this. The advantage of the CNAME is that if the IP address of www.example.com changes, you only have to change it in one place (the A record for www.example.com), rather than 2. The disadvantage is a small penalty in the time it takes to resolve the domain name in some cases.
(My preference is to always use A records and avoid CNAMEs, unless there need to be some many domains pointing to the same host that it would be an extreme inconvenience if the IP address ever changes. I alway use A records pointing to the same IP for www/non-www.)
Anyway, two ways to do this are, as already stated:
1. Use multiple A records to create multiple hosts under your domain name.
2. Use a reverse-proxy running one one or the other of the machines to forward traffic to the other. this way you can avoid having to expose multiple hosts to users.
You could, of course, run the reverse-proxy on a third machine.