private static InetSocketAddress getFirstDomainController(String domainName)
			throws NamingException {

		DirContext ctx = new InitialDirContext();

		Attributes attributes = ctx.getAttributes("dns:/_ldap._tcp.dc._msdcs." + domainName,
			new String[] { SRV_RECORD_TYPE });
		if (attributes.get(SRV_RECORD_TYPE) == null) {
			return null;
		}

		String srvRec = attributes.get(SRV_RECORD_TYPE).get().toString();

		String[] recParts = srvRec.split("\\s+", -1);

		int port = Integer.parseInt(recParts[2]);
		String host = recParts[3];

		return new InetSocketAddress(host, port);
	}
Returns the first Microsoft Active Directory domain controller for the specified domainName.

@param domainName the local domain name of the MS Active Directory system
@return address of the domain controller, or null if not found
@throws NamingException
Ghidra/Features/GhidraServer/src/main/java/ghidra/server/security/Krb5ActiveDirectoryAuthenticationModule.java