-
-
Notifications
You must be signed in to change notification settings - Fork 254
Description
I'm running one blocky instance for "many routers". Each router have local DNS records (A + PTR) for local LAN clients. These routers are segmenting into different private IP networks.
With this conditional mapping, A + PTR DNS queries works fine.
conditional:
mapping:
lan1.local: 192.168.1.1
lan2.local: 192.168.2.1
lan3.local: 192.168.3.1
1.192.in-addr.arpa: 192.168.1.1
2.192.in-addr.arpa: 192.168.2.1
3.192.in-addr.arpa: 192.168.3.1
I would like to enable clientLookup using PTR. But in clientLookup is possible to have only one upstream, and not different upstreams for different arpa subdomains (LAN subnets).
I'm using this hack currently:
clientLookup:
upstream: 127.0.0.1
clients:
localhost:
- 127.0.0.1
Blocky ask itself for PTR of client IP and conditional mapping from first config example is used. To prevent looping, 127.0.0.1 is static mapped to "localhost" client ID. Thus second request doesn't created another one to 127.0.0.1 again to resolve client ID of 127.0.0.1.
It works, but I guess it's bit hackish.
Suggested solutions:
- Allow to have conditional upstream in clientLookup
- Allow clientLookup to handle PTR lookup internally - without calling DNS query to itself but asking correct DNS resolved from conditional mapping.
Thanks.