All you have to do is to settup your server in order to have http://site1.domain.com/index.php and http://site2.domain.com/index.php being the same file.
I know that the host configuration can be really different from one host to another, so you should better try to find that in the documentation of your host...
As for DNS, you only have to put the same IP address to the DNS site1.domain.com and site2.domain.com.
Bookmarks