473,563 Members | 2,904 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 2982
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
5200
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...
1
2589
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 ...
0
2697
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
2248
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
2598
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...
7
2144
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...
0
4183
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
14490
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...
0
7583
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...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5484
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...
0
5213
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...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
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
1
1200
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.