Microsoft365 and new on-prem AD: Domain double suffix
I have had a domain on Microsoft 365 for many years now. For example sake, call it: mydomain.com
I have recently created an on-prem AD server.
To try to keep things seperate, I have name my AD server: idm.mydomain.com
I am now at the stage I want to join machines to the domain. However, when I try to it fails.
I notice that whenever I do an nslookup, I am getting the following response
Non-authoritative answer:
Name: cnn.com.mydomain.com
Address: (MS 365 IP Address here)
The exact error I get when attempting to join a machine to the domain is:
An Active Directory Domain Controller (AD DC) for the domain "idm.mydomain.com" could not be contacted.
Ensure that the domain name is typed correctly.
In the trouble shooting screen:
The error was: "No records found for the given DNS query"
(error code 0x0000251D DNS_IINFO_NO_RECORDS)
The query was for SRV record for _ldap._tcp.dc._msdcs.idm.mydomain.com
I realize that this means something in my DNS server is incorrect and likely has to do with M365 DNS as well.
Could someone point me in the right direction?