There is MikroTik RB941-2nD-TC (hAP lite 802.11n 300Mbps 2.4GHz 4xLAN) The router has the standard address 192.168.88.1 Wi-Fi network works

A laptop is connected to the router with a network cable. Denwer is running on a laptop with a local site, for example site.loc . Running in the browser http: //site.loc - works fine on a laptop (the site opens).

A permanent ip is associated with the MAC address of the laptop: 192.168.88.5 In the settings of the router /webfig/#IP:DNS.Static a bunch of the following is added:

enter image description here

Brandmaur on a Windows laptop is simply disabled. In the site.loc / www Denwer site folder there is a .htaccess in which it is written:

# dnwr_ip 192.168.88.5 

all according to the instructions: www.denwer.ru/faq/shared.html

How to provide access to the site http: //site.loc from any device (tablet, computer, phone) connected to the Wi-Fi network of the router?

    3 answers 3

    There are two options.

    For any (almost) router.

    • set up port forwarding.
    • go to any free dns service (for example, noip.com) and register a name for yourself, set up a router so that it updates the app. tplink / asus routers can do this.
    • use this name and go to the server from any place.

    But this method does not work if you have a local internal ip on your router. I have a static apy and I use this method in full to access my home resources.

    The second method (and it looks like you described it). mikrotik can do "static dns" - that is, you can tell him how to resolve an unknown name. This will be available to all devices within the network that have received the dns settings from the router (it usually indicates itself as dns). Details on the setting - on the website mikrotik . In short, you need to execute the command in the micro console.

     /ip dns static add name site.loc address=192.168.88.5 

    and here is the gui method.

    This method has one drawback - if a user specifies dns in the settings with pens, then he will not work (although there is little that was invented, it may filter, but I think this is unlikely, but technically feasible). Also, I would reconnect the devices, clean the cache, there is little. It is also worth looking at what settings the router gives to the clients - which dns it indicates. Must specify yourself.

    • your command: "/ ip dns static add name site.loc address = 192.168.88.5" completely repeats what I did through the web interface - Enshtein
    • I don’t worry about changing dns settings on phones and tablets - these are three scary unknown letters for those who will use this local site over a Wi-Fi network. I did not write a word about connecting to the Internet, it will not be in this local Wi-Fi network. But still it doesn’t work) - Enshtein
    • Then the last option remains - to raise your DNS server, for example, bind. - KoVadim
    • on the computer? By the way, is that the devices connected to this Wi-Fi network are also connected to the Internet, for example, through 3G, how does this affect something? - Enshtein
    • Full The device can use dns from 3g - KoVadim

    You need to register your router as a DNS server on the devices from which you want to access the site. Then, when the site.loc site is requested on such a device, the device will contact the DNS server (router) for the IP address, receive an IP from it of 192.168.88.5 and send the request there.

    • And without registering the DNS server on the devices can not be? This is a complete madness, I will have different mobile devices: tablets, phones on iOS and Android. - Enshtein
    • @Enshtein: possible without changing DNS. But then you have to manually register on each device the name of site.loc with the desired IP. There is a third option - take the real domain (you can subdomain) and register for it A record with the desired IP. This should be done on those NS where the domain is serviced. Then, it will be possible to find out on which IP domain is located on any device. Well, or another option - do not apply by name, but directly by IP. - MANK
    • a) from the Wi-Fi network there will be no access to the Internet - I didn’t write anything about the Internet in question b) to prescribe the correspondence manually? How do you imagine this to be done on the tablet, phones? c) the option of addressing by ip is not at all in the subject already ... - Enshtein
    • See above - I suggested a way through configuring the firewall on mikrotik - gecube

    Make sure that other devices get your site's IP from DNS MikroTik. Connect via WiFi from another laptop and check with the command.

     nslookup site.loc 

    You should see the IP you registered, and the DNS server should be MikroTik. To understand whether the case in the DNS Mikrotik, exactly, tried to register on the device that connects to WiFi, in the hosts file entry

     192.168.88.5 site.loc 

    Did you connect the second computer with a wire? Does not work only through WiFi? Looking towards the firewall and bridge settings on MikroTik'e? WiFi clients see each other? In winbox there is a useful thing Tools-> Torch. What do you have there when you are trying to access from your server to your server?