Web-server – How to access a web server application from other Pcs in the local network

node.jsweb-server

I have setup a Microserver to run a node.js web server using the express framework .

I have enabled the port number from Windows Firewall (Advanced Settings , Windows Server 2012), and i can access the web application from other Pcs in the local network by using :
localIPAddressOfServer:PortNumber i.e 192.68.0.14:8080 .

What i want to do :

I want to access the server from other Pcs by using something more user friendly than IP addresses .

What i have tried :

I have tried accessing the server from the servers name i.e MyServerName:8080 and in some cases it works . It doesn't work on MacOs pcs and generally I don't think that is the best practice for doing this .

The ideal scenario is to find some kind of Alias to replace the IP address

Any ideas ?

Best Answer

It's working from the Windows machines because they still use NETBIOS for some name resolution on private Windows networks.

You will need to set up your own local DNS server, which is not a small undertaking, and probably overkill for a single server.

If it's a very small network of clients, quickest solution is probably to add an entry into the hosts file of every client. This is located at C:\Windows\System32\drivers\etc on Windows systems and at /etc/hosts on MacOS. The file is self-documented.

Related Topic