How do I make an application available only on my wireless network?

4

I'm developing an application, and I want it to be available only for devices connected to my Wi-Fi network.

I can even let it run on my personal computer and access via ip, something like 192.168.1.20:8080 . But I wanted to go a little further and access through an address like www.minhaaplicacao.com . Of course, this address will only exist internally, so only the devices connected to my network will have access.

The question is, how? Am I going to have to configure the router? I do not understand almost any networking: /

    
asked by anonymous 20.01.2016 / 18:18

1 answer

5

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.

    
20.01.2016 / 18:46