I have an OpenWRT router setup, 192.168.1.1
, with search domain, local
(as opposed to the default lan
).
I have a server setup, 192.168.1.200
, with hostname, server.local
.
I have a workstation, 192.168.1.10
, with hostname, workstation.local
.
server.local
also operates an NGINX reverse proxy, to provide subdomains such as, sub.server.local
.
If my workstation tries to access, server.local
, it is resolved correctly to point at 192.168.1.200
.
However, if my workstation tries to access, sub.server.local
, it can't resolve to 192.168.1.200
.
If my workstation has 192.168.1.200 sub.server.local
, added to its hosts file, it resolves correctly, and the servers reverse proxy routes the incoming connection to the correct port.
How do I fix this, so that all subdomains of server.local
resolve to 192.168.1.200
? Without having to add a hosts record to every workstation, for every subdomain on the server, which is obviously not sustainable.
I'm assuming that I need to alter some DNS records on my OpenWRT router, but looking through the settings in Luci (the web interface), nothing sticks out as being capable of achieving this.
Any ideas?
Best Answer
I sorted it out eventually.
According to:
https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#a_and_aaaa_rr
Which states:
I was able to login to OpenWRT (using
ssh root@192.168.1.1
), and running:Which then allows the following to work:
And anything else for that matter:
As I understand it, this creates an A record in DNSMasq, which automatically includes all subdomains.
The changes can be seen in
/etc/config/dhcp
, which now looks (partially) like:Hopefully this helps someone else in the future!