I want to know my ip address for internet. I use gethostname() and then gethostbyname() with the result of the first. Now I get a list of all my IPs, but how do I know which one is the internet ip? The only way I can imagine is to check which network class the ip is. Is this a good idea, or is there a better way?