A host which part of Active directory domain does authentication from the logon server (domain controller).
LOGONSERVER env var has its value.
C:>echo %LOGONSERVER% \PUN5OPSDIRPIN01
Is there any API using which I can retrieve this value?
Nearly every language or framework will have a method that will let you retrive the values of environment variables. .NET, Powershell, Java... What are you coding in?
WMI (using VBS):
Assuming you want to retrieve that from the client, you could query "HKCU:\Volatile Environment\LOGONSERVER" or env:LOGONSERVER.