DNS Resolve problem in .NET 2.0???
-
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?????????? [This is new .NET 2.0 method that replaced the former .Resolve method] private void LookupIP(string entry) { try { IPHostEntry IP = Dns.GetHostEntry(entry); txtBox2.Text = IP.HostName; } catch(Exception exception) {
-
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?????????? [This is new .NET 2.0 method that replaced the former .Resolve method] private void LookupIP(string entry) { try { IPHostEntry IP = Dns.GetHostEntry(entry); txtBox2.Text = IP.HostName; } catch(Exception exception) {
hi, the following three lines are working for me & successfully resolves an IP to hostname.you are probably missing the second line i.e you are not parsing the string to an IPAddress. IPAddress ipis; ipis = IPAddress.Parse(address); string hostname = Dns.GetHostEntry(ipis).HostName; try this and then see what happens.
-
hi, the following three lines are working for me & successfully resolves an IP to hostname.you are probably missing the second line i.e you are not parsing the string to an IPAddress. IPAddress ipis; ipis = IPAddress.Parse(address); string hostname = Dns.GetHostEntry(ipis).HostName; try this and then see what happens.
No didn't work for me either. Be sure your workstation is: a. Windows XP Pro (sp 2) b. VS2005 .NET c. .NET 2.0 So far I'm using the GetHostByAddress method, although I recieve a 'yellow' warning during the compile, it does still compile and not halt in error like the Resolve method does now since .NET 2.0. The program will open and run as usual. However, I would like a flawless code like before the .Resolve obsolecsence. string hostname = System.Net.Dns.GetHostByAddress(IPAddress.Parse(entry)).HostName;