DNS (?): how to manage * subdomains of my reverse proxy? (*.mylan "point" to a same ip?)

Hi,
I'm trying to introduce a sort of reverse proxy in my lan, so I have not to remember ip and port of each service. Note that most of them are on the same machine, so the only port can be used to distinguish them, for example 172.16.10.10:1000 is service1 while 172.16.10.10:2000 is service2.

I have installed a reverse proxy - nginx proxy manager - where I can add proxied hosts as subdomains of the proxy itself... but soon rise a problem: how/if should I configure the DNS on my openWrt router so it knows this? Infact it knows the hostname-ip couple of the proxy itself, but if I try to reach a subdomain, I cant.

I mean: suppose the host proxy.lan is 172.16.10.10:80... I can reach it because openWrt DNS knows it too; this proxy manages the two services (on the same machine...) service2.proxy.lan and service1.proxy.lan. (The great thing will to not use the subdomain but having proxy.lan/service1 etc, but I have find how to do this yet).

Now, the questions: should I do something on the router? Can tell him somewhere that all *.proxy.lan name requests should "point" to 172.16.10.10, so the proxy can manage them? Or Am I forced to install a reverse proxy on openWrt (dont think, seems strange to me)? What is the best practice, what am I not considering? I read - fast - the DNS/DHCP wiki page but it is very difficult.

Note: I have dns-over-https installed but this mechanism/config I need should intercept my lan domain as dns manages the other hostnames, on a different level, that is "should not be a problem...

Thanks!!!

read here https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#a_and_aaaa_rr on the forum that this maybe the solution (code from wiki)

uci add_list dhcp.@dnsmasq[0].address="/home/10.10.10.1"
uci commit dhcp
/etc/init.d/dnsmasq restart

in my case will be:

uci add_list dhcp.@dnsmasq[0].address="/proxy.lan/172.16.10.10"
uci commit dhcp
/etc/init.d/dnsmasq restart

but

  1. dont understand it, may someone explains how it works, if it will (have not tested to avoid damage)? :frowning:
  2. dont know if works with dns-over-https proxy packages installed

ok I choose to risk and....

... It works!!!!
But why? How? :D:D:D:D:D

ok, this is a blog-thread :smiley:
Just seen that the above command just added an entry in:
Network => DHCP and DNS => General Settings => Addresses
The line is /proxy.lan/172.16.10.10

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.