It depends on how you go about it and the control panel your hosting provider offers.
Generally if you have one hosting plan but have added two domains to it, then one of them will be a 'master' domain, and the other will be an add-on. The add-on will have its own folder and you would place all its files at that file. So you'll have to add a copy of all the files in that file.
The other method is to as you said before, create an index2.php, however, you'll have to set-up forwarding so the domain goes to index2.php. By default it won't go to index2.php. In CPanel, when you create an add-on domain, it will automatically create a subdomain, so the add-on domain will point to the subdomain. You can change the subdomain to point to a different location, for example index2.php.
█ InnoHosting, Performance Web Hosting || US: 1-888-522-INNO UK: 0800 612 8075
█ Web Hosting - Virtual Servers - Managed Servers - Application Hosting
█ Reseller Hosting with WHMCS & Preloaded KB | SSL | activGuard | End User Support
█ LiteSpeed / CloudLinux / Idera Backups / True 24x7 Support / 10+ Years in Business