473,320 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DNS.GetHostEntry problems

Hi all,

I have a small "irritant" to do with DNS resolving in .NET Framework v2.0.

For this example, assume the following network information;
Local IP address is 192.168.0.10, on a PC named "PC_01"
Remote address is 192.168.0.20, on a local LAN, and named "PC_02"

DNS.GetHostByAddress("192.168.0.20").Hostname returns "PC_02"
DNS.Resolve("192.168.0.20").Hostname returns "PC_02"

Both these methods are marked obsolete in v2.0 of the framework, and
GetHostEntry is recommended as the replacement. However;

DNS.GetHostEntry("192.168.0.20").Hostname returns "192.168.0.20" .....
not the hostname!!

The only other thing I've noticed is that
DNS.GetHostEntry("192.168.0.10").Hostname returns "PC_01", so it seems to
work on the local node.

Anyone got any idea why!??! Is it just an annoying but in GetHostEntry()??
:(

--
__________________________________
The Grim Reaper
Feb 6 '06 #1
2 6170
Problem solved by MS.... but not til Vista!!

http://lab.msdn.microsoft.com/produc...c-9f5963abc489

"The Grim Reaper" <gr*********@REMOVEbtopenworld.com> wrote in message
news:ds**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi all,

I have a small "irritant" to do with DNS resolving in .NET Framework v2.0.

For this example, assume the following network information;
Local IP address is 192.168.0.10, on a PC named "PC_01"
Remote address is 192.168.0.20, on a local LAN, and named "PC_02"

DNS.GetHostByAddress("192.168.0.20").Hostname returns "PC_02"
DNS.Resolve("192.168.0.20").Hostname returns "PC_02"

Both these methods are marked obsolete in v2.0 of the framework, and
GetHostEntry is recommended as the replacement. However;

DNS.GetHostEntry("192.168.0.20").Hostname returns "192.168.0.20" .....
not the hostname!!

The only other thing I've noticed is that
DNS.GetHostEntry("192.168.0.10").Hostname returns "PC_01", so it seems to
work on the local node.

Anyone got any idea why!??! Is it just an annoying but in
GetHostEntry()?? :(

--
__________________________________
The Grim Reaper

Mar 6 '06 #2
Oh - and while I'm at it.. if anyone else comes across this particular bit
of code, the way round it is to configure a hosts file for your network.
Not ideal if you've got DHCP and constantly changing IP addresses.. but it
works.
__________________________________________
The Grim Reaper

"The Grim Reaper" <gr*********@REMOVEbtopenworld.com> wrote in message
news:ds**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi all,

I have a small "irritant" to do with DNS resolving in .NET Framework v2.0.

For this example, assume the following network information;
Local IP address is 192.168.0.10, on a PC named "PC_01"
Remote address is 192.168.0.20, on a local LAN, and named "PC_02"

DNS.GetHostByAddress("192.168.0.20").Hostname returns "PC_02"
DNS.Resolve("192.168.0.20").Hostname returns "PC_02"

Both these methods are marked obsolete in v2.0 of the framework, and
GetHostEntry is recommended as the replacement. However;

DNS.GetHostEntry("192.168.0.20").Hostname returns "192.168.0.20" .....
not the hostname!!

The only other thing I've noticed is that
DNS.GetHostEntry("192.168.0.10").Hostname returns "PC_01", so it seems to
work on the local node.

Anyone got any idea why!??! Is it just an annoying but in
GetHostEntry()?? :(

--
__________________________________
The Grim Reaper

Mar 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
1
by: 3f | last post by:
Hello; We have made a web application that people can download from our web site and installed on: Windows XP Windows 2000 Professional Windows 2003 Server Windows 2000 Server
5
by: Corky | last post by:
This works: db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID = PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
3
by: ad | last post by:
Hi, I use the code below to get the IP of computer: My computer has only one ip: 192.168.0.100, But there are tree IPs get by GetHostEntry: 192.168.0.100 192.168.0.1 192.168.122.1 Why?
3
by: RWF | last post by:
I am trying to do a reverse DNS lookup using Dns.GetHostEntry in .NET 2.0, but it seems to kind of crap out when the result is an answer with multiple records. It doesnt seem to give any type of...
2
by: The Grim Reaper | last post by:
Hi all, I have a small "irritant" to do with DNS resolving in .NET Framework v2.0. For this example, assume the following network information; Local IP address is 192.168.0.10, on a PC named...
3
by: Steve Richter | last post by:
I am using Dns.GetHostByAddress and Dns.Resolve to successfully resolve and IP address to an IPEndPoint. IPEndPoint ep = null; IPAddress ipAddr = IPAddress.Parse(m_sRemoteHost); ep = new...
5
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I am trying to get the DNS name of an arbitrary IP address on the network. If I use GetHostEntry as the documentation suggests I only get the name of the machine I am running the code on. All...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.