OPNsense Forum

English Forums => General Discussion => Topic started by: hakuna on February 18, 2021, 01:25:35 AM

Title: [SOLVED] Clean install and new to OPNSense: DNS releated question
Post by: hakuna on February 18, 2021, 01:25:35 AM
Hi guys,

I am very happy to have this piece of the art running on my network but I have a few questions driving me nuts.


Once I have this solved, I need to jump to IoT with DNS hardcoded. My TV has Google DNS hardcoded and I only found out thanks to Sensei.

Thank you so much guys for any help :)
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: allebone on February 18, 2021, 01:31:56 AM
Why dont you set pihole to use 1.1.1.1 as a forwarder instead of your opnsense firewall and ensure pihole machine is allowed out to 1.1.1.1 on port 53?
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: hakuna on February 18, 2021, 01:59:12 AM
Pi-Hole is running recursive DNS. I don't need to use a third upstream for that.
No Google, no OpnDNS, no IBM. It calls all 13 root nameservers and that is it.

I just wanna make them the only DNS server on my network as they were before running OPNSense.
Just like I do with OpenWRT for example. No DNS should be redirected to nowhere else.
Title: Clean install and new to OPNSense: DNS releated question
Post by: Greelan on February 18, 2021, 02:24:51 AM
I have a similar setup. Pihole and unbound running on a separate box, with unbound configured as a recursive resolver.

In my case I have put the pihole/unbound box IP (v4 and v6) under System/Settings/General, and checked the box to disable the local DNS as a nameserver. But I don't have unbound or any other resolver running on OPNsense anyway. I have also disabled DNS rebinding protection on OPNsense as that was preventing local name resolution from pihole (unbound itself gives me that protection for external resolution). And I have made sure I have firewall rules to allow all VLANs to reach the pihole/unbound box.

That's it, and it works.

Configured this way OPNsense passes out the pihole/unbound IPs as DNS nameservers, via DHCP for IPv4 and (in my case) RA/RDNSS for IPv6, to all local clients. No need to configure anything specifically for those services as they pick up the system setting if nothing specific is configured.
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: hakuna on February 18, 2021, 03:43:55 AM
Quote from: Greelan on February 18, 2021, 02:24:51 AM
I have a similar setup. Pihole and unbound running on a separate box, with unbound configured as a recursive resolver.

In my case I have put the pihole/unbound box IP (v4 and v6) under System/Settings/General, and checked the box to disable the local DNS as a nameserver. But I don't have unbound or any other resolver running on OPNsense anyway. I have also disabled DNS rebinding protection on OPNsense as that was preventing local name resolution from pihole (unbound itself gives me that protection for external resolution). And I have made sure I have firewall rules to allow all VLANs to reach the pihole/unbound box.

That's it, and it works.

Configured this way OPNsense passes out the pihole/unbound IPs as DNS nameservers, via DHCP for IPv4 and (in my case) RA/RDNSS for IPv6, to all local clients. No need to configure anything specifically for those services as they pick up the system setting if nothing specific is configured.

You are a saviour  8)
I did follow your steps but I still without internet.
Then I realised, my routers use 192.168.1.1 and I did set OPNSense 192.168.1.2 to reduce the downtime if things don't work.
Then I also realised my Pi-Holes gateway set as 192.168.1.1.
That is why they would only work after adding OPNSense as Upstream.

Man, I am feeling so damn stupid right now.

Now, I just need to test my Xbox again, it should work now. I could not even log in yesterday haha
Otherwise, I still have a big problem.

Thank you so much for the help, you made me realise the problem was in front of the keyboard  ;D
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: Greelan on February 18, 2021, 03:46:05 AM
Hehe [emoji23]
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: hakuna on February 19, 2021, 02:12:13 AM
Problem solved.

My Pi-Holes are the only DNS server, everything trying to bypass it is blocked by the firewall and redirected to Pi-Hole, including DNS-over-HTTPS and DNS-over-TLS.

I got OPEN Nat on my Xbox without having UPnP installed.
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: chemlud on February 19, 2021, 09:30:19 AM
Quote from: whiiiskyy on February 19, 2021, 02:12:13 AM
... everything trying to bypass it is blocked by the firewall and redirected to Pi-Hole, including DNS-over-HTTPS

Hmmm, how do you achieve this?
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: Greelan on February 19, 2021, 09:41:01 AM
Lol, I was thinking the same thing
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: allebone on February 19, 2021, 11:35:06 PM
Probably by using sensei. You can tick the option I think that sensei maintains a blocklist of doh ip addresses and ports.
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: AhnHEL on February 20, 2021, 12:19:53 AM
https://labzilla.io/blog/force-dns-pihole
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: Greelan on February 20, 2021, 12:23:50 AM
Not perfect - relies on the DNS server list being comprehensive - but better than nothing I guess
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: hakuna on February 24, 2021, 08:21:33 AM
I don't know how to tag a user here lol

For those who asked, I followed this page: https://labzilla.io/blog/force-dns-pihole

Everything is working like a charm, well, only my smart TV is being a pain in the ass and still somehow able to bypass the firewall.
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: hakuna on February 24, 2021, 08:30:30 AM
Quote from: Greelan on February 20, 2021, 12:23:50 AM
Not perfect - relies on the DNS server list being comprehensive - but better than nothing I guess

If you don't mind me asking, which approach are you using to deal with this problem?
Thanks
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: Greelan on February 24, 2021, 08:50:59 AM
No problem. I don't do anything at the moment - that is something on my list! The guide you linked looks useful, so thanks.

My comment was just an observation that with DOH necessarily the solution is only as good as the DNS list.
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: chemlud on February 24, 2021, 09:30:57 AM
...and for hard-coded IPs it won't help at all, I guess. The DNS-over-https trash has left the whole DNS problem with a big, big hole.
Title: Re: Clean install and new to OPNSense: DNS releated question
Post by: allebone on February 24, 2021, 08:39:46 PM
There are DOH IP lists.