v-terryf
Wed Feb 22 22:30:13 CST 2006
Hi Shaun,
Welcome to MSDN Newsgroup!
I hope the following article is also helpful for you:
Title: C# .NET DNS query component
URL:
http://www.codeproject.com/csharp/dnslookupdotnet.asp
Best Regards,
Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
--------------------
>Thread-Topic: Programatically find the configured DNS server
>thread-index: AcY3w2GhYTAJzQ1WQgaUkhdBCImaYA==
>X-WBNR-Posting-Host: 217.196.245.2
>From: "=?Utf-8?B?QkxzdW5ldg==?=" <sunev@nospam.nospam>
>Subject: Programatically find the configured DNS server
>Date: Wed, 22 Feb 2006 07:19:32 -0800
>Lines: 14
>Message-ID: <5E511751-B2B6-4360-9B6A-9AAB768F30B6@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.dotnet.framework
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework:109057
>X-Tomcat-NG: microsoft.public.dotnet.framework
>
>I have some c# code to perform DNS lookups but currently need to provide
the
>IP address of the DNS server it uses. I would like to be able to identify
>the addres of the currently configured DNS server(s) and use this so that
the
>app will effectively configure itself.
>
>Can anyone please tell me how I can do this, I know with .NET 2.0 and the
>System.Net namespace Dns is available that can provide the IP address /
>hostname of the system, but I need more than just this - I want the DNS
>server.
>
>Thanks in advance,
>
>--
>Shaun Venus
>