How can you determine the hostname associated with an IP on the network? (without configuring a reverse DNS)
This was something that I thought was impossible. However I've been using Fing on my mobile. It is capable of finding every device on my network (presumably using an arp-scan) and listing them with a hostname.
For example, this app is capable of finding freshly installed Debian Linux devices plugged into a home router, with no apparent reverse DNS.
As far as I know neither ping, nor Neighbor Discovery, nor arp include a hostname. So how can fing be getting this for a freshly installed Linux PC? What other protocol on a Linux machine would give out the machine's configured hostname?
Best Answer
The zeroconf protocol suite (Wikipedia) could provide this information.
The best known implementations are AllJoyn (Windows and others), Bonjour (Apple), Avahi (UNIX/Linux).
Example showing a list of everything on a LAN (in this case not very much):
More specifically, you can use
avahi-resolve-address
to resolve an address to a name.Example