@Lazher YAAKOUBI Thanks for posting in our Q&A.
For this issue, did you not enroll windows devices using MDM automatic enrollment? Here is the article about setting up automatic enrollment:
https://learn.microsoft.com/en-us/mem/intune/enrollment/windows-enroll
If we enroll Windows 10/11 devices using MDM automatic enrollment, we don’t have to worry about configuring CNAME records for the MDM server.
I think setting up automatic enrollment is more convenient. If possible, please try it.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.