How can I find out whether a given IP address is an official internet address or an internal intranet IP address?
Intranet IP's are often in the private IP range:
10.0.0.0 through 10.255.255.255
172.16.0.0 through 172.31.255.255
192.168.0.0 through 192.168.255.255
These are not usable for internet IP addresses.
See also http://compnetworking.about.com/od/workingwithipaddresses/f/privateipaddr.htm
The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private internets:
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
source
RFC 1918 defines some IP address ranges which can't exist on the internet, and are therefore suitable for intranet use (i.e. 10/8, 172.16/12, 192.168/16).
Apart from that, what do you mean? Are you trying to find out which IPs are on the same subnet as your own machine, or on some other 3rd party network?
See also http://en.wikipedia.org/wiki/Private_network
10.0.0.0 - 10.255.255.255` (10.0.0.0/8, former Class A)
172.16.0.0 - 172.31.255.255` (172.16.0.0/12, former Class B)
192.168.0.0 - 192.168.255.255` (192.168.0.0/24, former Class C)
Founding out that given IP belongs to that, depends in what form do you have given IP. The best way to use bytes.
Besides those A,B,C intranet classes, there are other reserved addresses not used as public internet IPs, especially:
There are also many wasted IP addresses (legacy from stupid ages). You won't see most addresses in range