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

Asked

Viewed 976 times

4

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

I can even leave running 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. Logically, this address will only exist internally, so only devices connected to my network will have access.

The question is, how? Will I have to configure the router? I understand almost nothing of networks :/

  • To use this type of address you will need a dns server, so you can interpret the ip of your machine as the given address. A legal solution would be the use of [no-ip], but it will be available on the web for whoever has the address you create there.

  • Good question, I think it will be very useful for many people. I don’t know anything about networks either so I can’t help you. But I will follow the question. Fav and +1

  • You will need to set up an internal DNS server, and I think for that Voce will have to configure your router to resolve this address internally. So the answer is yes, you need to configure your router to resolve this domain internally.

  • You can buy a TP-LINK N750 and change its firmware to Openwrt. You will have a router running Linux. The sky is the limit in this case. You can have a DNS server, VPN server, VPN client, iptables, etc. Changing the firmware is a matter of updating the original firmware, but uploading Openwrt. Very simple and easy. It even has a web interface called Luci.

1 answer

5

More robust routers (with more features) have DNS server option. But they are usually more expensive routers and it is not common for a home user to own.

Anyway, check if the router or modem you have offers such 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, only in this case it would be for an intranet. This would be to avoid having to configure all devices one by one.

If you want something simpler, no DNS server, just add the fictitious DNS in the hosts file of each device that you want to access the application.

Example,

The machine that runs the application has IP 192.168.0.10

On the machine you want to access, edit the hosts file

For Windows, open any notepad or 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 domain www.foo.bar to the IP 192.168.0.10.

If you want to play more you can enter 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 DNS and save.

To test, in both cases, ping

ping www.foo.bar

The result must resolve the name for the IP 192.168.0.10

Now you can access the application by name. In the browser, just type in the URL www.foo.bar.

Obviously the machine that runs the application should be free of access to the application port. Normally port 80.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.