Wednesday, November 16, 2016

networking - Is the name of a private Linux computer discoverable in its LAN?



1) Is the name of a private Linux computer discoverable in its LAN by default?



I'm talking about the name that is first entered when installing a GNU/Linux desktop OS, the one that in Ubuntu is displayed in System Settings -> Details -> Device name, or in a bash prompt after the @, or as the result of the hostname command.




I've tried different networking tools to get my machine's hostname (unfortunately I can test them only from the target itself) and none of them would succeed:




  • nbtscan doesn't reveal my host at all, I think because it's only supposed to work on Windows hosts

  • nmap -sn reveals my host but not my hostname

  • arp -a doesn't reveal my host at all, I think because a device is not supposed to appear in its own ARP table; but maybe if I were to look at the ARP table of another LAN device I would find my hostname there



I'm here assuming the desktop OS has been just installed, and the computer has no extra software that would give it non-default networking capabilities.




2) If the hostname is indeed indiscoverable by default, what are commonly used networking packages that would make the computer start sharing its hostname?



There are several services that do hostname broadcast as part of their offerings, generally you can't rely on a system having any of them installed.




  • samba - windows compatible network shares and discovery

  • avahi - bonjour/DLNA/UPNP announcement and discovery




if you have the IP address of the computer (as found by arp) and it runs ssh then you could do this to ask the computer what its called



ssh user@ip.ad.dr.es hostname

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...