#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
#include <Windns.h>
int main()
{
DNS_STATUS status;
PDNS_RECORD ret;
status = DnsQuery("_xmpp-client._tcp.yandex.ru",
DNS_TYPE_SRV,
DNS_QUERY_STANDARD,
NULL,
&ret,
NULL);
if(status == 0) {
printf("SRV %s:%d\n", ret->Data.SRV.pNameTarget, ret->Data.SRV.wPort);
DnsRecordListFree(ret, 0);
} else {
printf("Record not found.\n");
}
return 0;
}