Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get my current DNS Server in C#?

Tags:

c#

How do I get my current DNS Server in C#?

like image 398
Greg Finzer Avatar asked May 25 '10 16:05

Greg Finzer


People also ask

How do I find my current DNS?

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.


1 Answers

See the MSDN on IPInterfaceProperties.DnsAddresses for sample code.

like image 88
Daniel Brückner Avatar answered Oct 11 '22 18:10

Daniel Brückner