Resolving one host name to different IP per VLANs
-
I use many VLANs. I would like to refer to the pfSense router using pfsense.home.arpa from all VLANs, to ease deployments.
E.g.
- VLAN1 uses IPs from 10.0.0.0/24,
- VLAN2 uses IPs from 10.0.1.0/24,
- VLAN1 clients should resolve pfsense.home.arpa to 10.0.0.1/32, and
- VLAN2 clients should resolve pfsense.home.arpa to 10.0.1.1/32.
There is no inter-VLAN routing allowed (and all VLAN clients connect to a proxy at 10.0.X.1:3128).
(I cannot create a static lease for the router based on MAC, as VLANs depend on their parent interface's MAC, so the router has the same MAC on all VLANs. Also, I would not like to create a single DNS entry with multiple IPs and resort to round-robin resolution.)
What would be the best way to achieve this setup? Thank you.
-
@tfuto that would be done with views. You can create views in unbound so clients on vlan 2 would resolve some fqdn to ip X, while clients on vlan 1 would resolve same fqdn to IP Y.
But you can not do views in the gui, have to be done in the options box.
-
Thank you @johnpoz! It took 10 minutes to actually understand your answer (pro Linux-er but noob FreeBSD-er here LOL), and actually this I can do. Awesome!
-
@tfuto well unbound runs on either linux or freebsd, so not sure about your answer ;)
But ok.. I do believe I have some posts here going over basic simple view setup..
Here is one back from 2017 when they first updated unbound to support views in pfsense
-
@johnpoz Just I have never yet run into unbound on Linux, that is all. (Maybe I am noob on Linux as well?
)
Thank you for the linked reference! Very useful!