OpenersNotesSection(Spacer1)Details

MLGetDomainNameList() loads the DNS domain names for each active network interface available on the machine.

MLGetDomainNameList() allocates memory to store the domain names that must be released. To release the memory allocated by MLGetDomainNameList(), call (NonWLLink[MLReleaseDomainNameList(), paclet:/ref/c/MLReleaseDomainNameList]) on the list returned by MLGetDomainNameList().

MLGetDomainNameList() returns NULL on failure.

MLGetDomainNameList() is declared in the MathLink header file (RefLink[mathlink.h, paclet:/ref/file/mathlink.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "mathlink.h"

/* A function that reads the domain names available on a machine */

void f(MLENV env)
{
	char **theList = NULL;
	char *tmp;
	unsigned long length;

	theList = MLGetDomainNameList(env, &length);

	if(length > 0 && theList != (char **)0)
	{
		while((tmp = *theList++) != (char *)0)
		{
			/* ... */
		}

		MLReleaseDomainNameList(env, theList, length);
	}
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLReleaseDomainNameList(), paclet:/ref/c/MLReleaseDomainNameList])  ▪  (NonWLLink[MLGetNetworkAddressList(), paclet:/ref/c/MLGetNetworkAddressList])}})}})