Win32 API and sockets question.
Hi all!
I'm trying to get two values for my app:
1) ISPN
2) DNS server from my ISP
is it possible with sockets? I already have the hostname and the IP:
Code:
char hostname[128];
HOSTENT *lpHost;
IN_ADDR inaddr;
// hostname
gethostname (hostname, sizeof hostname);
SetDlgItemText(hwndDlg, IDC_EDIT1, hostname);
// ip
lpHost = gethostbyname(hostname);
memcpy(&inaddr, lpHost->h_addr_list[0], 4);
SetDlgItemText(hwndDlg, IDC_EDIT2, inet_ntoa(inaddr));
Thanks for the tips.