I think that you need to use CSD to check whether computer belongs to domain or not.
Then you could create DAP policies and organize connectivity policies according to attributes which CSD checks locally on machine.
CSD can check windows registry so you must find out which registry is responsible for it, Im not sure about it but try:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Domain.
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\CachePrimaryDomain
hope it helps
regards