To be able to join a machine to a domain, it must be able to resolve the DNS domain name of target domain. You set a domain controller as DNS resolver in the machine if the DNS domain zone is hosted in domain controllers. You should also check if all required network port is opened between the machine and domain controllers.
Please don't forget to accept helpful answer