The lib file must be linked to the project using Settings->Link->General and the header file can be placed to project folder.
Code: Select all
#include <windows.h>
#include "Windns.h"
#include <iostream>
int main()
{
char sDomainName[100];
DWORD size = 100;
DNS_STATUS res = DnsQueryConfig(
DnsConfigFullHostName_A,
FALSE,
NULL,
NULL,
sDomainName,
&size
);
std::cout << sDomainName << std::endl;
return 0;
}