Solved - Multi homed host question
-
Is there any way to get DNS resolver to return the nearest host to the subnet the lookup is done from.
I’ve got a subnet 172.16.2.x/24 where my Apple iDevices sit and an IOT lan where my Apple TV’s sit, I’ve got a NAS that’s multi homed on both subnet, the IOT subnet nas interface has a firewall rule on the nas to only allow SMB from the Apple TV’s.
I’ve tried the following custom options, but lookups still return 172.16.2.10 then 172.15.4.10 regardless of the subnet the lookup is done from:-
local-data: "nas.xyz.net A 172.16.2.10"
local-data: "nas.xyz.net A 172.16.4.10"I’m using an app on my iDevices and Apple TV’s called infuse and it syncs share data info iCloud.
-
I’ll have a play with this:-
https://medium.com/nlnetlabs/client-based-filtering-in-unbound-d7da3f1ef639
-
Code in Resolver Custom options:-
define-tag: "NAS-IOT" access-control-view: 172.16.4.0/24 NAS-IOT access-control-view: XXXX:YYYY:ZZZZ:4::/64 NAS-IOT view: name: "NAS-IOT" local-zone: "xyz.net" inform local-data: "nas.xyz.net A 172.16.4.10" local-data: "nas.xyz.net AAAA XXXX:YYYY:ZZZZ:4::a" view-first: yes
From 172.16.2.0/24 & XXXX:YYYY:ZZZZ:2::/64:-
andyk@mac-pro ~ % host nas nas.xyz.net has address 172.16.2.10 nas.xyz.net has IPv6 address XXXX:YYYY:ZZZZ:2::a andyk@mac-pro ~ % host loghost loghost.xyz.net has address 172.16.2.10 loghost.xyz.net has IPv6 address XXXX:YYYY:ZZZZ:2::a andyk@mac-pro ~ %
From 172.16.4.0/24 & XXXX:YYYY:ZZZZ:4::/64:-
pi@homebridge:~ $ host nas nas.xyz.net has address 172.16.4.10 nas.xyz.net has IPv6 address XXXX:YYYY:ZZZZ:4::a pi@homebridge:~ $ host loghost loghost.xyz.net has address 172.16.2.10 loghost.xyz.net has IPv6 address XXXX:YYYY:ZZZZ:2::a pi@homebridge:~ $