TIL that I can assign a .local domain to my laptop. No more diving into network settings to find the IP address and then typing it on a client device on my home network to access a web server running on my laptop.

On macOS, you can set this up easily:

  1. Go to System Settings > General > Sharing.
  2. Under Local hostname, click Edit.
  3. Change the local hostname to your desired name.local and save.
macOS Sharing settings for local hostname

Editing the local hostname in macOS Sharing settings.

This registers the hostname via Bonjour/mDNS, which resolves to your Mac’s IP address on the local network.

Now, for example, you can access a local web server from your phone by simply typing mac.local:3000 into the browser.