detect used dns server(s)
i have seen various methods to get the ip-address of a computer. i was wondering if there is a way of getting the used dns server once i detected the ip used for online access.
Archive: detect used dns server(s)
detect used dns server(s)
i have seen various methods to get the ip-address of a computer. i was wondering if there is a way of getting the used dns server once i detected the ip used for online access.
Hi Yathosho,
because of your question I decided to make a plugin I used for this ready for publication.
You can find it here:
http://nsis.sourceforge.net/IpConfig_plugin
To get what you want:
IpConfig::GetNetworkAdapterIDFromIPAddress $IPAddress
Pop $0 ; Get success or failure
Pop $1 ; Get result or error message
StrCmp $0 "ok" 0 error
GetNetworkAdapterDNSServers $1
Pop $0
Pop $2 ; $2 will contain all DNS servers, seperated by a space.
DetailPrint "DNSServers for IP address $IPAddress: $2"
Goto end
error:
DetailPrint "error: $1"
end:
great, i will give it a try. thanks jp!