Home All Groups Group Topic Archive Search About

DNS name resolution in .Net

Author
13 Jan 2005 11:15 AM
Rob Levine
Hi All,

Is there any way within .Net to do a DNS lookup ONLY from a given server
about its own DNS records?

I am having a problem with name resolution which is detailed in this post
(posted to m.p.d.l.csharp yesterday):

Thanks in advance for any help,

Rob Levine
-----------------------------------------------------
Hi All,

This is a cut down version of a post from earlier entitled "Name resolution
in .Net". Apologies, for the repeat, but I think the first post was too
verbose (it came from a blog article of mine) and I think a shorter post
here is probably more appropriate.

I am seeing some incorrect behaviour on System.Net.Dns.Resolve( hostname )
It would appear that this does more than just a DNS lookup (which is what it
says  in the documentation), at least when resolving the address of the
local machine.

I have a server with two NICs and hence two IP addresses: 10.0.0.5 and
192.168.0.2. Only the latter of these has a DNS entry (mapping to the host
name 'terminus'). The former IP address is not listed anywhere (DNS or hosts
file).
If I call System.Net.Dns.Resolve( 'terminus') from the server itself, I get
both IP addresses coming back. How is this possible if the call is only
doing a DNS lookup? A test with nslookup verifies that the name 'terminus'
has a single A record only, pointing to 192.168.0.2.

My suspision is that this call is also checking the NetBIOS name cache;
"netstat -a terminus" lists the same results as the resolve call. If so,
this is not what the documentation says it does.

Any ideas anyone ?
Is it possible to do a DNS lookup ONLY on a hostname ?

Thanks in advance for any help,

Rob Levine
http://roblevine.blogspot.com

Author
13 Jan 2005 5:05 PM
Ivar
Hi,

See if

http://www.lumisoft.ee/lswww/download/downloads/Examples/

dnsquery.zip suits to you

Show quote
"Rob Levine" <rob_levine@hotmail.SPAMPROOF.com> wrote in message
news:gLsFd.9514$GG1.7399@text.news.blueyonder.co.uk...
> Hi All,
>
> Is there any way within .Net to do a DNS lookup ONLY from a given server
> about its own DNS records?
>
> I am having a problem with name resolution which is detailed in this post
> (posted to m.p.d.l.csharp yesterday):
>
> Thanks in advance for any help,
>
> Rob Levine
> -----------------------------------------------------
> Hi All,
>
> This is a cut down version of a post from earlier entitled "Name
> resolution
> in .Net". Apologies, for the repeat, but I think the first post was too
> verbose (it came from a blog article of mine) and I think a shorter post
> here is probably more appropriate.
>
> I am seeing some incorrect behaviour on System.Net.Dns.Resolve( hostname )
> It would appear that this does more than just a DNS lookup (which is what
> it
> says  in the documentation), at least when resolving the address of the
> local machine.
>
> I have a server with two NICs and hence two IP addresses: 10.0.0.5 and
> 192.168.0.2. Only the latter of these has a DNS entry (mapping to the host
> name 'terminus'). The former IP address is not listed anywhere (DNS or
> hosts
> file).
> If I call System.Net.Dns.Resolve( 'terminus') from the server itself, I
> get
> both IP addresses coming back. How is this possible if the call is only
> doing a DNS lookup? A test with nslookup verifies that the name 'terminus'
> has a single A record only, pointing to 192.168.0.2.
>
> My suspision is that this call is also checking the NetBIOS name cache;
> "netstat -a terminus" lists the same results as the resolve call. If so,
> this is not what the documentation says it does.
>
> Any ideas anyone ?
> Is it possible to do a DNS lookup ONLY on a hostname ?
>
> Thanks in advance for any help,
>
> Rob Levine
> http://roblevine.blogspot.com
>
>
>
Author
13 Jan 2005 5:11 PM
Rob Levine
Thanks Ivar - much appreciated.
I still find it hard to believe that something as basic and fundamental is
not part of the core framework!

Regards,

Rob

Show quote
"Ivar" <i**@lumisoft.ee> wrote in message
news:%23T7SIIZ%23EHA.936@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> See if
>
> http://www.lumisoft.ee/lswww/download/downloads/Examples/
>
> dnsquery.zip suits to you
>
> "Rob Levine" <rob_levine@hotmail.SPAMPROOF.com> wrote in message
> news:gLsFd.9514$GG1.7399@text.news.blueyonder.co.uk...
>> Hi All,
>>
>> Is there any way within .Net to do a DNS lookup ONLY from a given server
>> about its own DNS records?
>>
>> I am having a problem with name resolution which is detailed in this post
>> (posted to m.p.d.l.csharp yesterday):
>>
>> Thanks in advance for any help,
>>
>> Rob Levine
>> -----------------------------------------------------
>> Hi All,
>>
>> This is a cut down version of a post from earlier entitled "Name
>> resolution
>> in .Net". Apologies, for the repeat, but I think the first post was too
>> verbose (it came from a blog article of mine) and I think a shorter post
>> here is probably more appropriate.
>>
>> I am seeing some incorrect behaviour on System.Net.Dns.Resolve(
>> hostname )
>> It would appear that this does more than just a DNS lookup (which is what
>> it
>> says  in the documentation), at least when resolving the address of the
>> local machine.
>>
>> I have a server with two NICs and hence two IP addresses: 10.0.0.5 and
>> 192.168.0.2. Only the latter of these has a DNS entry (mapping to the
>> host
>> name 'terminus'). The former IP address is not listed anywhere (DNS or
>> hosts
>> file).
>> If I call System.Net.Dns.Resolve( 'terminus') from the server itself, I
>> get
>> both IP addresses coming back. How is this possible if the call is only
>> doing a DNS lookup? A test with nslookup verifies that the name
>> 'terminus'
>> has a single A record only, pointing to 192.168.0.2.
>>
>> My suspision is that this call is also checking the NetBIOS name cache;
>> "netstat -a terminus" lists the same results as the resolve call. If so,
>> this is not what the documentation says it does.
>>
>> Any ideas anyone ?
>> Is it possible to do a DNS lookup ONLY on a hostname ?
>>
>> Thanks in advance for any help,
>>
>> Rob Levine
>> http://roblevine.blogspot.com
>>
>>
>>
>
>

AddThis Social Bookmark Button