0

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 <my_ip> doesn't reveal my host at all, I think because it's only supposed to work on Windows hosts
  • nmap -sn <my_ip> 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?

1

1 Answer 1

1

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 [email protected] hostname
1
  • avahi seems to be installed by default on Ubuntu 16.04. I could easily get my hostname with avahi-resolve-address <my_ip>, which returns <my_hostname>.local
    – doctypeme
    Jun 7, 2016 at 15:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .