Windows Coding
Published:
How to get DNS Server for particular adapter on Windows
- Retrieve addresses information about adapter through API:GetAdapterAddress(…)
- Loop to check whether current pointer points to the adapter specified by verify the attributes like FirstUnicastAddress.
- if the pointer points to the specified adapter, FirstDnsServerAddress data member points to the head of the linked list which stores the list of dns server for the specified adapter.