[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

DNS server override for application

Alex Chudnovsky

3/2/2008 3:26:00 PM

Hi,

I've got an application that heavily uses .NET HTTP functions, that in
turn use DNS resolves - I would like to make my application use specific
DNS servers that happen to be more reliable in terms of resolves than
average consumer grade network setup, the question is whether it is
possible at all in a .NET app without moving away completely from
build-in HTTP library?

Version of .NET in question is 2.0+.

regards,

Alex
4 Answers

Kevin Spencer

3/3/2008 2:20:00 PM

0

No, it's not possible without moving away from built-in classes, such as the
System.Net.Dns class, which does not allow you to configure the DNS server
it connects to. It is possible, of course, by writing a class that uses a
TCP Socket to send and receive queries to and from any DNS server.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

"Alex Chudnovsky" <alexc@majestic12.co.uk> wrote in message
news:ehtwzmHfIHA.1824@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I've got an application that heavily uses .NET HTTP functions, that in
> turn use DNS resolves - I would like to make my application use specific
> DNS servers that happen to be more reliable in terms of resolves than
> average consumer grade network setup, the question is whether it is
> possible at all in a .NET app without moving away completely from
> build-in HTTP library?
>
> Version of .NET in question is 2.0+.
>
> regards,
>
> Alex


Alex Chudnovsky

3/3/2008 4:08:00 PM

0

Kevin Spencer wrote:
> No, it's not possible without moving away from built-in classes, such as the
> System.Net.Dns class, which does not allow you to configure the DNS server
> it connects to. It is possible, of course, by writing a class that uses a
> TCP Socket to send and receive queries to and from any DNS server.
>

Yes, that's what I thought myself - it is very odd that Dns class does
not allow to specify alternative Dns servers and that HttpWebRequest
can't accept cached Dns resolves done earlier - and shared source code's
license does not allow changes to be made to this code to them use it in
your own application (unless it's non-commercial - which is too big of a
restriction).

regards,

Alex

Kevin Spencer

3/4/2008 1:19:00 PM

0

I find the greatest benefit to the shared source code (or any open source
code) is in seeing how they solved the problem. One can then incorporate a
similar (or even improved) approach without violating any licensing
agreements.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

"Alex Chudnovsky" <alexc@majestic12.co.uk> wrote in message
news:ef4y6iUfIHA.5180@TK2MSFTNGP05.phx.gbl...
> Kevin Spencer wrote:
>> No, it's not possible without moving away from built-in classes, such as
>> the
>> System.Net.Dns class, which does not allow you to configure the DNS
>> server
>> it connects to. It is possible, of course, by writing a class that uses a
>> TCP Socket to send and receive queries to and from any DNS server.
>>
>
> Yes, that's what I thought myself - it is very odd that Dns class does
> not allow to specify alternative Dns servers and that HttpWebRequest
> can't accept cached Dns resolves done earlier - and shared source code's
> license does not allow changes to be made to this code to them use it in
> your own application (unless it's non-commercial - which is too big of a
> restriction).
>
> regards,
>
> Alex


Alex Chudnovsky

3/5/2008 2:39:00 PM

0

Kevin Spencer wrote:
> I find the greatest benefit to the shared source code (or any open source
> code) is in seeing how they solved the problem. One can then incorporate a
> similar (or even improved) approach without violating any licensing
> agreements.
>

It might be useful in some cases for sure, however when it comes to
extending functionality it is useless because it is too easy to taint
your own code by doing something that is just too similar in existing
sources so I reluctantly decided not even to look at implementation of
HttpWebRequest - it looks like the only avenue is to take Mono's
implementation and modify it :(

It is really odd Microsoft does not allow some degree of modification
designed to improve applications running on .NET platform - I can
understand they don't want people to take whole of CLR to change a few
lines and claim they have their own .NET implementation, but allowing to
extend elements of class library to use in commercial applications is a
must IMO.


regards,

Alex