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:
- Go to
System Settings>General>Sharing. - Under
Local hostname, clickEdit. - Change the local hostname to your desired
name.localand save.
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.
RecurSim