Hi all, I'm trying to set up a segmented network at home and give each VLAN its own domain. I'm almost there but am missing the final piece of the puzzle.
I set up 2 instances of dnsmasq and assigned each one to its own bridge interface, lan
and iot
, this works great and everything is assigned an IP in the right range.
Now I would like devices from lan to resolve those from iot (and possibly the other way around), and I tried to set up a DNS forward for the iot domain in the lan dnsmasq, but it doesn't seem to work.
Here's my current config:
config dnsmasq 'lan_dns'
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases.lan'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
list interface 'lan'
option localservice '0'
list address '/gl-mt6000.lan/192.168.2.1'
list server '/*.iot/192.168.10.1'
list server '127.0.0.1#1053'
list server '::1#1053'
config dhcp 'lan'
option instance 'lan_dns'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option ra 'server'
list ra_flags 'managed-config'
list ra_flags 'other-config'
option dhcpv6 'server'
config dnsmasq 'iot_dns'
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/iot/'
option domain 'iot'
option expandhosts '1'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases.iot'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
list interface 'iot'
list notinterface 'loopback'
option localservice '0'
list address '/gl-mt6000.iot/192.168.10.1'
list server '127.0.0.1#1053'
list server '::1#1053'
config dhcp 'iot'
option instance 'iot_dns'
option interface 'iot'
option start '100'
option limit '150'
option leasetime '12h'
option ra 'server'
list ra_flags 'managed-config'
list ra_flags 'other-config'
option dhcpv6 'server'
With that drill only resolves iot devices when directed at the iot dnsmasq instance:
root@gl-mt6000:/etc/config# drill lifx-bathroom.iot @192.168.10.1
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 42854
;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; lifx-bathroom.iot. IN A
;; ANSWER SECTION:
lifx-bathroom.iot. 0 IN A 192.168.10.205
;; AUTHORITY SECTION:
;; ADDITIONAL SECTION:
;; Query time: 0 msec
;; SERVER: 192.168.10.1
;; WHEN: Sat Dec 14 11:42:57 2024
;; MSG SIZE rcvd: 51
root@gl-mt6000:/etc/config# drill lifx-bathroom.iot @192.168.2.1
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 44396
;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; lifx-bathroom.iot. IN A
;; ANSWER SECTION:
;; AUTHORITY SECTION:
;; ADDITIONAL SECTION:
;; Query time: 0 msec
;; SERVER: 192.168.2.1
;; WHEN: Sat Dec 14 11:43:01 2024
;; MSG SIZE rcvd: 35
Any idea what I could be missing? Also is there a way to achieve this using a single dnsmasq instance? Right now the Openwrt overview is confused because I have 2 DHCP leases files, and half my devices appear to have no domain appended to their hostname.