For the past week i've been trying to redirect DNS request to use my internal DNS. Unfortunately, i can't get it to work.
Interface: VLANTESTProtocol: TCP/UDPDestination / Invert: TickedDestination: VLANTEST addressDestination port range: From: DNS - To: DNSRedirect target IP: 192.168.99.11Redirect target port: DNSNAT Reflection: Disable
Interface: VLANTESTProtocol: TCP/UDPDestination / Invert: TickedDestination: VLANTEST addressDestination port range: From: DNS - To: DNSRedirect target IP: 208.67.222.222Redirect target port: DNSNAT Reflection: Disable
Interface: VLANTESTProtocol: TCP/UDPDestination / Invert: TickedDestination: 8.8.8.8Destination port range: From: DNS - To: DNSRedirect target IP: 192.168.99.11Redirect target port: DNSNAT Reflection: Disable
"From: DNS" is wrong for the port range. DNS clients use random source ports. Only the destination port is well defined and always 53.
Interface: VLANTESTProtocol: TCP/UDPSource /Invert: TickedSource: 192.168.99.11Source Port range: From: Any - To: AnyDestination / Invert: TickedDestination: 8.8.8.8Destination port range: From: DNS - To: DNSRedirect target IP: 192.168.99.11Redirect target port: DNSNAT Reflection: Disable
NAT Rule 1: Redirect DNS queries to PiHole Interface: VLANTEST Protcol: TCP/UDP Source: VLANTEST net Source Port range: From: Any - To: Any Destination / Invert: Ticked Destination: 192.168.99.11 Destination Port Range: From: DNS - To: DNS Redirect Target IP: 192.168.99.11 Redirect Target Port: DNS
NAT Rule 2: Exempt PiHole from DNS query redirects (Above Rule 1) No RDR (NOT): Ticked Interface: VLANTEST Protcol: TCP/UDP Source: VLANTEST net Destination: Any Destination Port Range: From: DNS - To: DNS
NAT Rule 3: Prevent clients from giving unexpected source errors Interface: VLANTEST TCP/IP Version: IPv4 Protcol: Any Source: VLANTEST net Source Port range: Any Destination: 192.168.99.11 Destination Port: DNS Translation / Target: Interface address Translation / Port: EMPTY
If i understand you correctly, i think you have the wrong assumption here. The "From" in my code segments, is the port Range of the Destination. Not the "Source". Unless you're talking about something else
So i stumbled upon a rather correct and detailed guide on LabZilla (https://labzilla.io/blog/force-dns-pihole)i tried out those rules and everything worked. I'm able to resolve domain names on both PiHole and the clients, and DNS is being redirected to my DNS server.I was getting close with last post. Traffic wasn't going to where it was supposed to be. I had the first ruleCode: [Select]NAT Rule 1: Redirect DNS queries to PiHole Interface: VLANTEST Protcol: TCP/UDP Source: VLANTEST net Source Port range: From: Any - To: Any Destination / Invert: Ticked Destination: 192.168.99.11 Destination Port Range: From: DNS - To: DNS Redirect Target IP: 192.168.99.11 Redirect Target Port: DNSBut what i mostly tried was to add a firewall rule to allow traffic from my DNS server. Instead, i needed to create another NAT rule, but without the port forwarding.Code: [Select]NAT Rule 2: Exempt PiHole from DNS query redirects (Above Rule 1) No RDR (NOT): Ticked Interface: VLANTEST Protcol: TCP/UDP Source: VLANTEST net Destination: Any Destination Port Range: From: DNS - To: DNS.I also added the 3rd rule the author described, to Firewall > NAT > Outbound. I'm not sure if i will come across it but i added it just to be sure.Code: [Select]NAT Rule 3: Prevent clients from giving unexpected source errors Interface: VLANTEST TCP/IP Version: IPv4 Protcol: Any Source: VLANTEST net Source Port range: Any Destination: 192.168.99.11 Destination Port: DNS Translation / Target: Interface address Translation / Port: EMPTYAll in all, over a week of blood, sweat and tears, i finally got what i wanted.