Access locally hosted web app using mac computer name

I have a web app running on my local machine.

I want to expose the app on my local corporate network.

I know that I can expose it via the currently assigned ip address as:


However I have figured out my local computer name using

scutil --get ComputerName

It returns my computer name as anands

I have it registered on my /etc/hosts file as anands

But when I try to expose it via


people on my local network are not able to access it


You need to add your IP address (not localhost and name to the local DNS server (another machine on your local network that is used as DNS server). In this way other computers will know that a corresponding name is located to your IP that they can reach.

The way you have done it, you are telling only to your machine that name and others can’t resolve that name to IP without the help of a DNS server

Source : Link , Question Author : Andy , Answer Author : Arra Alb

Leave a Comment