OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Tutorials and FAQs »
  • HOWTO - Redirect all DNS Requests to Opnsense
« previous next »
  • Print
Pages: 1 ... 6 7 [8]

Author Topic: HOWTO - Redirect all DNS Requests to Opnsense  (Read 145545 times)

hushcoden

  • Hero Member
  • *****
  • Posts: 551
  • Karma: 23
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #105 on: July 29, 2024, 01:21:50 pm »
Can someone please clarify if the 'source port range' must be set on DNS or any and why?

Tia.
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6923
  • Karma: 583
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #106 on: July 29, 2024, 01:29:29 pm »
Source port range for DNS lookups is "any". A client may pick any random port, usually one >= 1024.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

August8828

  • Newbie
  • *
  • Posts: 46
  • Karma: 0
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #107 on: November 02, 2024, 07:47:23 am »
Would it also be advised to create a blockrule for port 53 dns when using dot or is enabling the redirect rule enough?
Logged

9axqe

  • Full Member
  • ***
  • Posts: 203
  • Karma: 4
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #108 on: November 02, 2024, 07:51:08 am »
I did a redirect, just in case there’s some badly configured device on the network with static DNS server IP.
Logged

Lakkiada

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #109 on: November 02, 2024, 12:45:31 pm »
The source port is randomly selected by the client, leave as any. Theoretically, the redirect rule "should" catch everything. I, however, also have block rules for port 53, 853, 5353 and 9953 - just in case - Zero Trust. Do be sure the redirect rule is above the block rules.

I also block DNS on the WAN if source is !WAN address on port 853 (also block all other 53,853,5353,9953). This effectively limits all DNS to my selected DNS over TLS servers.
« Last Edit: November 02, 2024, 01:17:10 pm by Lakkiada »
Logged

August8828

  • Newbie
  • *
  • Posts: 46
  • Karma: 0
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #110 on: November 03, 2024, 07:37:13 pm »
How do I redirect ipv6 dns queries? Redirecting it to ::1?
Logged

9axqe

  • Full Member
  • ***
  • Posts: 203
  • Karma: 4
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #111 on: November 03, 2024, 08:30:14 pm »
That's what I'm doing, yes.
Logged

vicking

  • Newbie
  • *
  • Posts: 21
  • Karma: 0
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #112 on: November 05, 2024, 10:33:07 am »
Quote from: sanji on January 11, 2021, 10:05:42 pm
I tried the different methods from this thread to redirect everything to my pihole with cloudflare upstream dns.

When I change the DNS server of my computer to 8.8.8.8 and go to https://www.dnsleaktest.com/ and start a test, it then shows a bunch of google servers, so it doesn't seem to work. Or is my understanding wrong?

In another thread (https://forum.opnsense.org/index.php?topic=15472.0) it is mentioned to create an outbound NAT translation. I haven't read that anywhere else. So is this needed?

Wondering this same question. Followed the guide but when I change my DNS server on my Iphone to 8.8.8.8 and run a dnsleaktest I can see the Google servers where I had expected my local unbound service?
Logged

9axqe

  • Full Member
  • ***
  • Posts: 203
  • Karma: 4
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #113 on: November 05, 2024, 11:01:31 am »
What does your server use in terms of DNS protocol? HTTPS, QUIC, TLS...?

If it's using DNS over HTTPs for example, you're going to have to block 8.8.8.8:443 (both UDP and TCP).

If you want to go down that route, there are lists of public DNS over HTTPS/TLS providers, such as https://public-dns.info/nameservers.txt, which you then need to configure as FW aliases.

For DNS over TLS or QUIC it's simpler, you simply block anything to port 853 or 8853 (no point in redirecting, the certificate would not match).
Logged

vicking

  • Newbie
  • *
  • Posts: 21
  • Karma: 0
    • View Profile
Re: HOWTO - Redirect all DNS Requests to Opnsense
« Reply #114 on: November 05, 2024, 02:47:58 pm »
Quote from: vicking on November 05, 2024, 10:33:07 am
Quote from: sanji on January 11, 2021, 10:05:42 pm
I tried the different methods from this thread to redirect everything to my pihole with cloudflare upstream dns.

When I change the DNS server of my computer to 8.8.8.8 and go to https://www.dnsleaktest.com/ and start a test, it then shows a bunch of google servers, so it doesn't seem to work. Or is my understanding wrong?

In another thread (https://forum.opnsense.org/index.php?topic=15472.0) it is mentioned to create an outbound NAT translation. I haven't read that anywhere else. So is this needed?

Wondering this same question. Followed the guide but when I change my DNS server on my Iphone to 8.8.8.8 and run a dnsleaktest I can see the Google servers where I had expected my local unbound service?

All working now.. after setting it up again! Even when using 8.8.8.8 I can see the dns used is my local DNS service! :)
Logged

  • Print
Pages: 1 ... 6 7 [8]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Tutorials and FAQs »
  • HOWTO - Redirect all DNS Requests to Opnsense
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2