Mountain Lion OSX Server One IP Virtual Sites www resolving to wrong Site I am trying to get 2 domains working properly with one static IP on ML OSX Server.

When I set a domain = www.domain2.com- it resolves to domain1.com. 
I have dns set for domain 2 at godaddy, where www.domain2.com and domain2.com both resolve to the IP.

I set an additional domain for domain2 in the server control panel as www.domain2.com. Both sites listen on the same IP.

Domain1 has a nameserver setup for the domain on a co-located mac mini.

============================================================================

I have two sites and one ip .I would like for the www subdomain to work for www.mysecondsite.com. after adding the subdomain www.mysecondsite.com in the control panel for osx server-- when I type www.mysecondsite.com the browser loads  www.firstsite.com. 

I do not have enough points to post in the comments. All I did was setup the server. left the default site as is . added firstsite. added secondsite. added www.secondsite.com in the subdomain portion of secondsite's preference box.

This is a new install. am i missing something?
here is what I did that messed things up.

I set domain1 as the hostname, when I should have been using an alias like server.domain1.com. Also, i had the static ip selected in both domains. So, I changed the hostname to server.domain1 and then changed both domains to listen on any port.