473,698 Members | 2,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dns.Resolve / GetHostByAddres s deprecated in c# 2?

Hello, i would like to retrieve the hostname from IP adress, but
according to microsoft (VS 2008 Express), DNS.Resolve and
GetHostByAddres s methods seem to be deprecated, and all i found on
google was people who wrote that the new method GetHostEntry didn't
work for what i do, because returned IPadress instead of the hostname.

So my question is : do you know a method for what i would like to do,
that is working well, and that is not deprecated ?
thx
Nico
Apr 2 '08 #1
1 2989
GetHostEntry returns the alias list for an ipaddress, which is all dns will
return from an ipaddress (reverse lookup).
-- bruce (sqlwork.com)
"Nicopilami " wrote:
Hello, i would like to retrieve the hostname from IP adress, but
according to microsoft (VS 2008 Express), DNS.Resolve and
GetHostByAddres s methods seem to be deprecated, and all i found on
google was people who wrote that the new method GetHostEntry didn't
work for what i do, because returned IPadress instead of the hostname.

So my question is : do you know a method for what i would like to do,
that is working well, and that is not deprecated ?
thx
Nico
Apr 2 '08 #2

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

Similar topics

1
5214
by: ruggierorizzi | last post by:
Hi everyone, i would like to know if there is a difference between gethostbyaddress method and $_SERVER. furthermore i hve a little problem using ip address resolution. Some ip address are resolved other not. Why?
1
471
by: Amy L. | last post by:
When I make the following call: IPHostEntry hostInfo = Dns.GetHostByAddress( hostIPAddress ) ; If the PTR (i.e. the IP address to name resolution) does not exist my program will start making Netbios calls (Name query to the remote host). The netbios lookup is very undesired. Is there a way to not perform the netbios query if the PTR record does not exist?
1
2604
by: huzz | last post by:
I wrote a method which takes an ip address and returns hostname as shown below. It works fine.. only problem i have is when the passed ip address is not found in the database the method throws this error message : The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for How can i prevent this error message and instead return "-" ? Many Thanks.
0
2698
by: Chris Godwin | last post by:
Can someone please tell me why the following code does not work? System.Net.IPHostEntry iph = System.Net.Dns.GetHostByAddress("66.218.70.49"); I get this error. An unhandled exception of type 'System.Net.Sockets.SocketException' occurred
5
2255
by: Sven | last post by:
Hi! I have a problem with System.Net.Dns.GetHostByAddress(ls_Request.UserHostAddress()).HostName Usually the call GetHostByAddress returns the correct hostname of the client, but sometimes I get a hostname like _CERDR1342B88E. Why? The clients are running under Windows CE.NET 4.1...
1
2629
by: Jed | last post by:
I have a class for logging information about user activity on a web site, but it suddenly became really slow. I was wondering what factors may have caused the slow down. Initially, I used the following code: ul.HostName = context.Request.UserHostName; Since the UserHostName is not always resolved, I opted for the following more effective code: IPAddress hostIPAddress = IPAddress.Parse(context.Request.UserHostAddress);
7
2152
by: kvnsdr | last post by:
I can type an IP address and receive Internet domain name and my workstation name however no other IPs of computers on our internal network will resolve to a thier machine name only to the same IP that is entered. What's up Microsoft???? I can say that before we switched over .NET 1.1 to 2.0 the Dns.Resolve(entry); would find a name for any IP, LAN or WAN. Q. Any ideas??????????
0
4189
by: Mike Kansky | last post by:
DNS.GetHostByAddress runs very slow for foreign IPs. I heard that DNS.BeginResolve can make asynchronous IP to Host resolve. Can anyone provide me an example of VB.NET code that would make asynchronous DNS.beginResolve call? I need it to make a try to resolve the IP to HOST and to quit if it's taking longer than 5 seconds.
5
14536
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 other IP’s returns the IP in the HostName property of the IPHostEntry object returned by GetHostEntry. If I use Dns.GetHostByAddress or Dns.Resolve I get the name, but these are marked as obsolete. What is the correct way to get this...
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9027
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.