If both domains point to the same website, you should generally just have a redirect setup from domain 2 to domain 1. This is better for search results, and will prevent issues like you mention above. Of course, each person's website is there own, and you may have valid reasons for doing it your way.
Finally, if the 2nd domain is a sub-domain (or sub-folder) of the main domain, you can use the same API key for both domains. You simply need to make sure the Base URL setting in your application is configured correctly.
Hope this helps, and good luck!