Example: ms_dns_nextresult

In the following example, the ms_dns_nextresult function prints all of the IP addresses in the list.

#include "mic_socket.h" 
	int rescnt = 0;
    char *results = NULL;
			
	lr_load_dll ( "micsocket.dll" );
			
    results = (char *) ms_dns_query("transaction"
             "URL=dns://<DnsServer>",
             "QueryHost=<Hostname>",
             NULL);
			
    // List all the results...
    while (*results) {
        rescnt++;
        lr_log_message( lr_eval_string("(%d) IP address for <Hostname> is %s"),
            rescnt, results);
        results = (char *) ms_dns_nextresult(results);
}