I have a DC running Windows Server 2012 with an internal IP of 172.31.27.158. It is both a DC and a DNS Server.
Here's proof that DNS is running fine:
The machine that I would like to add to the domain has an internal IP of 172.31.18.222
When I run ipconfig on the client machine I get:
However, when I try to add it to the domain, I get this:
Here's the full message:
Note: This information is intended for a network administrator. If you are not your network's administrator, notify the administrator that you received this information, which has been recorded in the file C:\Windows\debug\dcdiag.txt.
DNS was successfully queried for the service location (SRV) resource record used to locate a domain controller for domain "contoso.com":
The query was for the SRV record for _ldap._tcp.dc._msdcs.contoso.com
The following domain controllers were identified by the query: win-ld81qu9k4eu.contoso.com
However no domain controllers could be contacted.
Common causes of this error include:
Host (A) or (AAAA) records that map the names of the domain controllers to their IP addresses are missing or contain incorrect addresses.
Domain controllers registered in DNS are not connected to the network or are not running.
Here are my IPv4 settings:
Also here are the group security settings:
How do I add a machine to the domain?
It appears that there's a firewall between the client and server that is blocking the communication required for the client to join the domain.
My suggestion would be that if the firewall is relevant only to these two instances that you unblock (allow) all traffic through the firewall between these two instances.
It seems that the DNS record for the DC could not have been found.
Have you tried adding the DC's IP to the preferred DNS servers under the computers IPv4 settings?