Hi. Im trying to figure out how to make openwrt propagate hostnames to three local networks (192.168.1.0, ..10.0, ..100.0). These are physical owrt routers.
I would like to be able to access the hosts in these networks by name.
Im not familiar with DNS, so after looking at the huge number of options in the settings, I went to AI for help... this is the answer:
To propagate hostnames across multiple local networks in OpenWrt, you can use the following approach:
Configure DNS and DHCP: Ensure that your main router is handling DNS and DHCP for all three networks. You can do this by setting up the DHCP server on the main router to assign IP addresses and hostnames for devices in all three subnets.
Edit
/etc/config/dhcp
: On your main router, edit the/etc/config/dhcp
file to include the necessary configurations for each subnet. For example:config dhcp 'lan' option interface 'lan' option start '100' option limit '150' option leasetime '12h' option dhcpv6 'server' option ra 'server' list dhcp_option '6,192.168.1.1' config dhcp 'lan2' option interface 'lan2' option start '100' option limit '150' option leasetime '12h' option dhcpv6 'server' option ra 'server' list dhcp_option '6,192.168.10.1' config dhcp 'lan3' option interface 'lan3' option start '100' option limit '150' option leasetime '12h' option dhcpv6 'server' option ra 'server' list dhcp_option '6,192.168.100.1'
Set Up DNS Forwarding: Ensure that DNS requests from all subnets are forwarded to the main router. You can do this by configuring the DNS settings on each router to point to the main router's IP address.
Use
dnsmasq
: On the main router, ensure thatdnsmasq
is configured to handle DNS for all subnets. You can add the following lines to the/etc/dnsmasq.conf
file:server=/lan/192.168.1.1 server=/lan2/192.168.10.1 server=/lan3/192.168.100.1
Restart Services: After making these changes, restart the DHCP and DNS services on the main router:
/etc/init.d/dnsmasq restart /etc/init.d/odhcpd restart
By following these steps, you should be able to propagate hostnames across your three local networks and access hosts by name.
Does that make sense? It is using "option 6" which as i understand redirects requests to a specific server right?
I should point out that DOH is running on all the routers and an Intercept-DNS forward is set on the main one as well just in case (at least i think thats why i initially set it up), so presumably Ill need to disable it as well...
Thanks in advance for any pointers, not sure I trust AI to do this just yet