The nslookup of the server doesnt matter, what matters is what is set internally to the Autodiscover SCP and that it resolves in DNS.
So if you want to set autodiscover internally to mail.domain1.com, then you need that on the cert as a subject name OR part of a wildcard.
Set-ClientAccessService -Identity <server> -AutoDiscoverServiceInternalUri "https://mail.domain1.com/autodiscover/autodiscover.xml"
If mail.domain1.com resolves in DNS and the subject is on the cert applied to IIS, then you are good.
when generating the CSR, include both of those subject names and ensure they are set in external DNS correctly to point to the external Exchange endpoint.
Internally, there is no absolute requirement to do this because domain joined machines will use the SCP, but I would anyway and create those records:
autodiscover.domain1.com
autodiscover.domain2.com
and have them point to the Exchange Server endpoints and have those as subject names on the certs!