Route Multipass instance names to permanently accessible local domains on macOS

This content was contributed by @sktripamer on GitHub: Support for static IP address · Issue #567 · canonical/multipass · GitHub


I’ve made a quick little utility NPM package for MacOS to route Multipass instance names to permanently accessible local domains.

npm install -g @sktripamer/unifypass
sudo unifypass start

Now you can access http://multipass-instance-name.multipass

By default it works with 80 and 443 with SSL passthrough. You can add more ports with:

sudo unifypass start --ports 8010,8020,8030

It works by creating a DNS server for the .multipass domain and forwarding it to the loopback address (127.0.0.1) where we have a reverse proxy getting the local network IP with ‘multipass list’, meaning it’s very responsive to any changes on the DHCP leases or any changes to multipass instances.

Sudo is needed to create the DNS server and listen on ports 80 and 443.

Haven’t tested all the features, but the basic start and stopping with the --ports flags seems to work, and I needed it for my own work, so deciding to publish now. Feel free to try to use and come back with any issues.

I see on the github repository that this tool is for MacOS, does it work also on Linux?

I was under the impression that the ability to do this on Linux was much less convoluted (maybe a console command or two), so I only did this so I could work on my Mac. For now it only supports Mac

1 Like

Thanks for pointing this out, I’ve added macOS to the topic title so it’s more visible.

1 Like