Re: local IP adresses / local host names
Re: local IP adresses / local host names
- Subject: Re: local IP adresses / local host names
- From: Quinn <email@hidden>
- Date: Thu, 10 Jul 2008 12:12:39 +0100
At 10:24 +0000 10/7/08, Andreas Fink wrote:
What is the correct way to get a list of local IP adresses and local
host names?
For IP addresses, TN1145 demonstrates a number of techniques.
<http://developer.apple.com/technotes/tn/tn1145.html>
For DNS names, the problem is not solvable even in theory: I can
happily add an name in my personal domain ("anarchistturtle.com")
that points to someone else's host, and there's no way that host can
discover its new name.
One reasonable heuristic is to reverse DNS each of the IPs (using
<x-man-page://3/getaddrinfo>, CFHost, or whatever), but that might
not give you the answer you're expecting. For example, my personal
web server is "anarchistturtle.com" but if you reverse map its IP
address you get "host217-41-101-22.in-addr.btopenworld.com".
If you can explain what you're using this information for, I can
offer up some better heuristics.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden