I have two remote OWRT routers connected by using OVPN.
What I want to achieve is:
To configure them that they will somehow use each of others local DNS, so that I can use my local domain names.
If will be first priority for cases when the the same public FQDN is in my local DNS and reference to my local network address (f.ex. for dev/test purposes.etc.)
It will still work with public DNS and router local DNS even if there will be some connection to my other router.
I am kinda begginer - while have long experience in Linux , but not every day networking. So I am a bit confused on all capabilities of dnsmaq an all those terms in docs.
So the question is - what techniques / terms should I use / search?
I would appreciate some link to a similar example.etc.
You can add the DNS server of the other side (usually the routers address) as the server for the other domain.
I have the same setup I use in /etc/config/dhcp:
list server '/home1/192.168.0.1'
The domain of the other side is home1 and DNSMasq is running on the other sides router 192.168.0.1
Next disable Rebind protection which will prevent queries from RFC1918 subnets either by disabling Rebind protection or better make an exempt for domain home1:
list rebind_domain 'home1'
On the other side (home1) make sure that DNSMasq will service queries from other non local subnets:
option localservice '0'
By default DNSMasq will listen on all interfaces so also on the VPN interfaces
Hmm, my idea was that both router networks is on the same local domain or no domain at all.
I am using use on both router networks machine01.lan , pc02.lan etc in local network to reach them. And I can reach from router1 (VPN client) machine01.lan and from router1 (VPN server) pc02.lan, but I can't reach machine01.lan from router2 and pc02.from from router1.