Server: mydomaincontroller.mydomaiSo what is "ad"?
main.com can't find ad: Non-existent domain
Note the trailing dot ( . ) in the DNS name. If that works, make sure you are using the domain DNS name and not the NETBIOS name to join the domain. If that doesn't work then we need to troubleshoot DNS.
If it does then in same time (along with ping) try add computer to domain again.
If name will not going to be resolved it mean your computer is not getting properly DNS names from DHCP
Check DHCP setting again.
You can try to put your domain controller name with local IP to local host file in C:\Windows\System32\driver
then try add computer to domain again. If this will work then for a 100% you have problem with DHCP or DNS propagation