-1

I have a device in a public network (I'm not the owner/admin of the WiFi) and I want to know if there is a way to get the devices IP address by knowing its hostname from a second device in the same network?

Fipsi
  • 113
  • 4

2 Answers2

3

If the network has a DNS service, query that for the hostname using a tool like host or dig. This will depend on the device being registered, either statically, by a DHCP service, or by dynamic registration on the device itself.

Many public networks do not do this for avoidance of cost & needless complexity and/or privacy preservation reasons. In that case, consult the network operator, who can infer this data from logs on relevant hardware devices (DHCP server, gateway, etc.).

Cosmic Ossifrage
  • 1,640
  • 14
  • 23
1

The multicast DNS protocol is designed to do exactly that. You simply append .local after the hostname of the device and you have a name that you can use with all the usual commands. For example:

ssh hostname.local
kasperd
  • 30,455
  • 17
  • 76
  • 124