471,354 Members | 1,190 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Odd IP address

I have an application that uses a socket. One of the users was complaining
that it would not work if they put the computer name in but only worked if
they put the IP address in. I had them run the below test program and the
problem was the first IP address is not valid. Obviously I need to do
better checking but does anybody have a clue why such an address would come
back anyway?

CODE:
string HostName = System.Net.Dns.GetHostName();
Console.WriteLine("Host Name: " + HostName);
System.Net.IPHostEntry ipHostInfo = System.Net.Dns.GetHostEntry(HostName);
foreach (System.Net.IPAddress ipAddress in ipHostInfo.AddressList)
Console.WriteLine(string.Format("IP Address: {0}", ipAddress));

OUTPUT:
C:\>iptest
Host Name: DELL
IP Address: ::1 <---- what is this and why????
IP Address: 192.168.1.7

Regards,
John
Jan 12 '06 #1
3 1260
Hi,

John J. Hughes II wrote:
only worked if they put the IP address in. I had them run the
below test program and the problem was the first IP address is not valid.
It is.
Obviously I need to do better checking
Yes. :)
IP Address: ::1 <---- what is this and why????


It's an IPv6 loopback address.
--
Chris Priede
Jan 12 '06 #2
P.S. Take a look at http://www.ietf.org/rfc/rfc2373.txt for details.
Jan 12 '06 #3
Hum! Well that explains it then.
Thanks
John
Jan 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Alexander N. Spitzer | last post: by
8 posts views Thread by YAN | last post: by
4 posts views Thread by andreas.w.h.k. :-\) | last post: by
6 posts views Thread by Nicolas Noakes | last post: by
36 posts views Thread by Julienne Walker | last post: by

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.