2

In computer networking, "hostnames" are limited to alphanumeric characters, with dashes (no whitespace or other punctuation).

However, when I open the "Network" in Finder...

Finder - Locations - Network

I can see some devices (usually macOS) show up with spaces, punctuation, and UTF-8 characters in the name:

Network devices. MacBook has spaces

Ultimately, I'm looking to have the Raspberry Pi on my network show up with a pretty name. However, in my searching on how to do this, I'm finding I'm not even clear on how macOS gets these pretty names to show up. Searching for this yields too many results of articles explaining to people how to change the hostname of their mac, which I don't need help with.

On my Raspberry Pi, I can run hostnamectl and set the "pretty" name, but that doesn't seem to affect anything.

Anyone know how this is achieved?

2
  • 1
    I don't know how to set this on a Pi (somewhere in Avahi's config?), but my understanding is that this is a DNS-SD (DNS Service Discovery) "Instance Name". According to RFC 6763 section 4.1.1, "The <Instance> portion of the Service Instance Name is a user-friendly name consisting of arbitrary Net-Unicode text [RFC5198]. It MUST NOT contain ASCII control characters (byte values 0x00-0x1F and 0x7F) [RFC20] but otherwise is allowed to contain any characters, without restriction..." – Gordon Davisson Apr 20 at 18:15
  • This is indeed not the hostname but the mDNS/DNS-SD name, and you can set one with Avahi on Linux. – John Keates Apr 20 at 19:23
-3

I think that macOS uses the command line program arp to scan the devices on the local network

Enter arp -a in the terminal

2
  • 2
    The ARP protocol resolves IP addresses to MAC addresses (aka Ethernet hardware addresses). The arp command displays what it's found, and tries to display DNS names for corresponding to the IP addresses -- but it's not what figures out those names, and in any case those are DNS names, not the "pretty" names OP is asking about. – Gordon Davisson Apr 20 at 18:20
  • Learned something new again. Many Thanks. – Darwin OS X Apr 20 at 22:02

You must log in to answer this question.

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