Hello all. I saw another topic on here, but to my understanding it didn’t seem to be looking for the same solution that I’m interested in.
For this question, assume the following conditions.
LAN network: 192.168.1.0/24
LAN network contains pfsense router at 192.168.1.1 running HAProxy listening on port 443 (pfsense gui is moved to a different port) that serves access via subdomains to various services (ie. Plex) running in docker containers in an unraid machine at 192.168.1.200.
vLan10: 192.168.10.0/24
vLan20: 192.168.20.0/24
Let’s say vlan10 is my WiFi network, and vlan20 is my IOT network.
Assume I have sufficient firewall rules in pfsense that all networks can access the HA proxy listening port and access the services using their subdomain with main domain address.
In an effort to create better separation of my LAN network and my IOT network vLan, I added a listening Ip address to HAProxy to also listen at port 443 on the subnet address of 192.168.20.1.
I would like all of my IOT devices to resolve my domain name, including all subdomains (like a wildcard) to ip address of 192.168.20.1, while also having that same domain and subdomains resolve to LAN address of 192.168.1.1 on all other networks.
This would prevent any IOT device ever having a need to cross into my LAN network at all.
I’ve arrived at this configuration in DNS resolver in pfsense, but it seems the only way to make this work properly is to list every subdomain and assign it an IP.
Is there a way to do this without having to list every subdomain?
DNS resolver example config:
server:
access-control-view: 192.168.1.0/24 main_view
access-control-view: 192.168.10.0/24 main_view
access-control-view: 192.168.20.0/24 iot_view
access-control: 192.168.1.0/24 allow
access-control: 192.168.10.0/24 allow
access-control: 192.168.20.0/24 allow
view:
name: "main_view"
view-first: yes
local-zone: “mydomain.com” transparent
local-data: "mydomain.com. IN A 192.168.1.1"
local-data: "plex.mydomain.com. IN A 192.168.1.1"
local-data: "otherservice.mydomain.com. IN A 192.168.1.1"
view:
name: "iot_view"
view-first: yes
local-zone: “mydomain.com” transparent
local-data: "mydomain.com. IN A 192.168.20.1"
local-data: "plex.mydomain.com. IN A 192.168.20.1"