How do I get my current DNS Server in C#?
Open your Command Prompt from the Start menu (or type “Cmd” into the search in your Windows task bar). Next, type ipconfig/all into your command prompt and press Enter. Look for the field labeled “DNS Servers.” The first address is the primary DNS server, and the next address is the secondary DNS server.
See the MSDN on IPInterfaceProperties.DnsAddresses
for sample code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With