Can I change the mDNS IP address?

On a Mac (if that is relevant) I have a Local site configured and it all works great from the local machine when accessed using the mDNS name mysite.local.

The name mysite.local resolves to

dscacheutil -q host -a name mysite.local
name: mysite.local

Is it possible to configure Local to return the LAN IP address instead of the localhost address so that it can be accessed from other devices on the LAN, such as mobile devices, for testing purposes.

If not, then is there another way to solve this problem?

This question has been asked before, but there was no answer.

Hi @glennr

Could you just utilize the Live Links feature to share the link to another device to view the site? Or is there another purpose to getting it loaded to another device? For clarity, you still wouldn’t be able to edit or make changes to the site regardless on another machine.

Hi @Nick-B,

That might work but I’m using it to provide a REST API as backend for an app. This uses HTTP authentication but so does the site. I can’t see how I can make that work together. Suggestions?

I figured out a solution. You can change the mDNS name of the host to your site name using scutil.

# get the current hostname so you can restore it later
scutil --get LocalHostName
# set the hostname to your site name
scutil --set LocalHostName mysite
1 Like

Thank you for the insight @glennr! Happy Developing :green_heart:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.