Get MAC address and/or name of a network host/device in the same Wi-Fi network

Hi all!

I am looking for some help with implementing network scan functionality similar to what an app like Fing or WiFiMan does (we're not interested in all features of these apps, just the network scan part to accommodate it to our idea/business needs.

We scan the Wi-Fi network and can get the list of IP addresses of other devices on the network using the PhoneNetSDK/MMLanScan (they seem to use Apple's SimplePing under the hood).

What we don't know is how to get additional information about these devices (for example MAC or host name/NETBIOS name).

Since this is not related to hotspot management, we can't use NEHotspotHelper (which seems to be the most common suggestion here on forums for the same problem).

Would love to hear some thoughts on this and suggestions how to get that information (MAC and/or hostname).

for example MAC

There’s no supported way to get Wi-Fi MAC addresses from iOS [1].

I can’t discuss other developers products but one thing to keep in mind is that products that interact with hardware can ask the hardware to perform tasks on their behalf, allowing them to display results that are not available on iOS.

host name

“Host name” is not a meaningful concept. Most folks assume that a host’s name matches its reverse DNS name. However, a device can have multiple IP addresses, and hence multiple reverse DNS names. Moreover, the reverse DNS mapping for a device name depends on the context (for example, inside or outside a firewall, or whether you ask via uDNS or mDNS).

If you want to do reverse DNS mapping, CFHost is the easiest API for that. To get started, see CFHostSample.

If you want to do reverse DNS mapping specifically using mDNS, see this post.

NETBIOS name

There’s no iOS API to work with NetBIOS. You can probably find this by running queries on the network, but I’m not familiar enough with the NetBIOS protocol to offer any hints in that regard.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] The sole exception here is the BSSID of the currently connected Wi-Fi, on the assumption the AP uses a MAC address as its BSSID.

Thank you, Quinn! Thanks for setting the expectations and for the idea of having some tasks performed by the remote hardware. It's not exactly what I'm trying to do (I want to gather information about any device on the network).

Let me look into the links you provided and get back either with results or with more questions!

Have a great day!

Get MAC address and/or name of a network host/device in the same Wi-Fi network
 
 
Q