Hi! Thanks for support.
Frankly I don’t know how to deal with this, but I now that whan I type an url on a browser it is not only solved by DNS, in a server there may be thousands of IP addresses, and I bet also redirects, and so on.
So my purpose is to connect to a WiFi and type on browser, for example, server.local
this should be somehow translated to http://192.168.0.100:1880/ui, do I have any chance to do it with mikrotik?
Actually I was just able to add a static DNS between 192.168.0.100 and server.local using Type A, but there a lot of others which I don’t know, anyway I’ve tried thaem without results.
Thanks
It’s not a function of DNS to redirect to different ports, the port remains same even if you mess with IP in /ip/dns/static. And HTTPS still require matching certificates for all names used. And if you’re using HTTP in 2023, that seem problematic.
Hi, thanks for answering,
I didn’t want to go off topic, here I’m trying another way, by DNS. There is about automatic redirect by dhcp and/or hotspot.
Yes node red uses http for dashboard, no reasons to complicate users life with certificates..
What about all DNS options in Mikrotik? I’ve just tested A, there are many more, nothing that can suite me?
You can just setup simple redirect with http server (httpd, nginx…) on 192.168.0.100:80 which redirects to http://192.168.0.100:1880/ui. It will work then if you open in browser http://server.local or http://192.168.0.100. Use DNS only to resolve 192.168.0.100.
You can also create virtual hosts with http servers, it will then depending on resolved host name forward traffic from service on different port, eg: https://gist.github.com/soheilhy/8b94347ff8336d971ad0. In this case if you have multiple http services on same server and you can access them just by assigning in DNS different host names to same IP.
Yes I understand that I can’t expect the phone will follow my request to open browser, and I agree there should be find a way to force it open for its user benefits, I mean this “captive portal”, which actually can be the NR/ui page.
My goal is to make as easy as possibile the connection to devices to node red UI page, the ideal scenario is connect to wifi and show up the browser with the node red dashboard page ready to go.
If I got right I can try:
inhibit internet connection after first connection for that IP and send phone info to open captive portal (this I guess can be bade by nikrotik hotspot and I hope without extrnal services/ devices)
the captive portal is the dashboard itself and the internet will be established, so the phone won’t disconnect itself from wifi or annoy with messages" this wifi doesn’t have interent, would you stay here?
Some solution may be possible using the captive portal specs, not DNS. But your requirement would have to change since you’d need HTTPS:
If you had HTTPS certificate available on NodeRED , you can use DHCP Option 114 on the Mikrotik to point to the HTTPS url of a new endpoint in NodeRED. The new endpoint return content-type of “application/captive+json” with the RFC8908 JSON that contain the actual status dashboard you’re trying to display upon Wi-Fi connection in the “user-portal-url”.
Please don’t cross-post to try to get better answers – one problem, one post. You’re back to the same questions as in the other thread