Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Why isn't my port forward that forces all DNS to be resolved locally working?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Why isn't my port forward that forces all DNS to be resolved locally working? (Read 1787 times)
baz
Jr. Member
Posts: 52
Karma: 1
Why isn't my port forward that forces all DNS to be resolved locally working?
«
on:
December 04, 2021, 07:07:21 pm »
I have setup a port forward to force all DNS queries to be resolved locally like so:
interface: LAN
source: any
source port: any
destination: !LAN net (inverted)
destination port: 53
nat IP: 127.0.0.1
nat port: 53
To test this, I changed the DNS on my wired LAN desktop to Cloudflare's 1.1.1.1 then did an nslookup of google.com and it returned that it was using server:
one.one.one.one (1.1.1.1)
instead of
192.168.0.1
as it should.
Any idea why?
Logged
Patrick M. Hausen
Hero Member
Posts: 6848
Karma: 575
Re: Why isn't my port forward that forces all DNS to be resolved locally working?
«
Reply #1 on:
December 04, 2021, 07:59:17 pm »
TCP+UDP?
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
baz
Jr. Member
Posts: 52
Karma: 1
Re: Why isn't my port forward that forces all DNS to be resolved locally working?
«
Reply #2 on:
December 04, 2021, 08:04:53 pm »
Good question, yes "TCP/UDP"
Logged
Greelan
Hero Member
Posts: 1028
Karma: 72
Why isn't my port forward that forces all DNS to be resolved locally working?
«
Reply #3 on:
December 04, 2021, 10:23:12 pm »
Are you sure it is not working? As far as nslookup is concerned, it is asking 1.1.1.1, but that doesn’t mean that the reply is coming from there
A good way to check is to query a local DNS record - if a correct reply is received, then the redirect must be working, because Cloudflare would not know about the local DNS record
Alternatively turn on logging on your rules and watch the traffic when a request is made
«
Last Edit: December 04, 2021, 10:30:04 pm by Greelan
»
Logged
baz
Jr. Member
Posts: 52
Karma: 1
Re: Why isn't my port forward that forces all DNS to be resolved locally working?
«
Reply #4 on:
December 04, 2021, 10:52:23 pm »
Great call! I didn't realize that's how it works, but I'm sure you're right, it just prints whats registered, not what's happening. Turning the forward off creates failures finding local domains and turning it on successes, so all is good again 👍
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Why isn't my port forward that forces all DNS to be resolved locally working?