If I remember correctly, your arp table doesn’t have to be complete. Assuming your Lan is on a Switch instead of a Hub, it shows the hosts your machine was connected with previously somehow. And I don’t think entries are automatically deleted from the table if a host goes offline or is added when a new one comes online.
Your switch has it’s own arp table (probably most complete if your Lan only has 1 switch). So has your router and your gateway.
As for hostnames, I think you can only get them via lookups.
IP Scanners basically do ping sweeps over the subnet to see if certain ports respond. If it does, then it does a lookup for the hostname.
Although a bit overkill (and not installed by default) but ‘nmap’ is an all-in-one tool for these kind of things.
Thanks Marco, but I’m not sure how that addresses the question…
I know about ARP… it returns a table of 256 entries for my LAN… and indicates which have an IP and MAC address assigned (for me that is currently 9 entries)…
I need to be able to take those 9 entries and say… This is my router (which is the ONLY one Arp names), the next is my printer, my Nas, my iPad etc…
The IPScanner app does this (but the “trial” only does a few devices, plus I want to use the data for other things as well)
PING, NSLOOKUP, ARP, SMCUTIL, DIG none return any NAME information, but it has to be there somewhere
As far as I understand, it’s a mixture of things because hostnames themselves are not part of TCP/IP.
LAN Hostnames/machine names are set with things like NetBui, NetBios, Bonjour, DNS-suffix, Search Domain etc. but unless you run a local DNS and each host has a full FQDN, there isn’t really a standard.
It may work if you set the DNS-suffix (Windows) / Search Domain (Mac) in your router’s DHCP settings. That way, the hosts register themselves with the router and it should respond to lookups.
Thanks Marco… but I think you are still missing the point…
I should not have to install anything new, I should not have to reprogram my router… This information is already available to other programs… But if you are not aware of the method they use to expose it, thats ok… I’ll keep looking…
Everything so far is NAME -> IP or NAME -> Mac
I need IP -> Name or Mac -> Name
On my LAN NSLOOKUP worked on ONE of nine IP addresses… I think it will return the name of any device that meets the criteria of a “server”… which in my case in my NAS and the router… but all the other devices are "different’… even though the IPSCANNER.APP can and does find their names
Norman… that code you referenced says a) it is not quite “done”, and b) is for ancient version of RealBasic (5.5), OSX does have SNMPWALK, but I have yet to figure out any meaningful information from/for it