Robust routers (with more features) have a DNS server option. But usually they are more expensive routers and it is not common for a home user to own.
In any case, make sure that the router or modem you have offers such a feature.
Alternatively, what you can do is mount a DNS server on your local network.
The process is the same as setting up a DNS for the internet, except in this case it would be for an intranet.
This would be to avoid having to configure all the devices one by one.
If you want something simpler, without a DNS server, just add the dummy DNS in the hosts file of each device you want to access the application.
Example,
The machine running the application has IP 192.168.0.10
On the machine you want to access, edit the hosts file
For Windows, open Notepad or any text editor in "Administrator" mode.
Using the text editor, open the file:
c:\windows\system32\drivers\etc\hosts
Add the line
192.168.0.10 www.foo.bar
Save the file. Ready! This machine will see the www.foo.bar
domain for 192.168.0.10
IP.
If you want to play more you can insert an existing domain, yahoo.com, for example, and see what happens.
For Linux systems, the same procedure. Using a text editor, open the file /etc/hosts
, add the DNS and save.
To test, in both cases, ping
ping www.foo.bar
The result should resolve the name to the IP 192.168.0.10
You can now access the application by name. In the browser, just type in the URL www.foo.bar
.
Obviously, the machine where the application is running must have the application's port access permissions enabled. Usually port 80.