site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On Mar 15, 2007, at 2:34 AM, subodh singh wrote: I want to retrieve hostname of router by using POSIX api. I have already achieved it by command arp, but it creates problem when DNS is configured on the machine and at that time it showing multiple entries. In that case its really difficult to recognise hostname of router. = Mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... If the router has multiple names, it has multiple names and that's all there is to it. arp is not the right way to go, though. Have a look at the 'route' command, and in particular examine the codepath associated with the command 'route get default'. This email sent to site_archiver@lists.apple.com