OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Advices to configure Unbound and Bind plugin for ad-block
« previous next »
  • Print
Pages: 1 [2] 3

Author Topic: Advices to configure Unbound and Bind plugin for ad-block  (Read 27176 times)

mayo

  • Jr. Member
  • **
  • Posts: 72
  • Karma: 4
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #15 on: November 24, 2018, 06:16:25 pm »
After configured Bind, my network devices are not resolved as .myhome but .local. Any idea?
Logged

mimino

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #16 on: December 21, 2018, 07:33:33 pm »
This recipe is described here https://www.routerperformance.net/opnsense/dnsbl-via-bind-plugin/ doesn't seem to work without firewall rules, which basically eliminate unbound altogether. Just like mayo, I wasn't able to get it to work with unbound 'forward-addr'. Not sure what the issue is, and the unbound log just says that the UDP query to 127.0.0.1:53530 timed out with no signs of DNS queries on the BIND side. Would really appreciate it if some gurus could shed some light as to what might be happening here.

Update: I tried to do unbound forwarding to a pi-hole instance I have running on my LAN, and forwarding didn't work either. There might be something crucial we're missing in unbound configuration, just have to figure out what that is.
« Last Edit: December 21, 2018, 08:04:05 pm by mimino »
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #17 on: December 21, 2018, 08:54:38 pm »
Outbound interface localhost?
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

mimino

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #18 on: December 21, 2018, 09:05:27 pm »
Quote from: mimugmail on December 21, 2018, 08:54:38 pm
Outbound interface localhost?
Nailed it! Thanks.
Logged

mayo

  • Jr. Member
  • **
  • Posts: 72
  • Karma: 4
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #19 on: January 15, 2019, 02:18:22 pm »
Hi mimino, could you please describe your configuration (I'll use Unbound with default config with Bind)? I'm tring to configure it from scratch and I don't want to make some mistakes...
Thank you so much!
Logged

Northguy

  • Full Member
  • ***
  • Posts: 118
  • Karma: 11
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #20 on: January 15, 2019, 04:00:27 pm »
Quote from: mayo on January 15, 2019, 02:18:22 pm
Hi mimino, could you please describe your configuration (I'll use Unbound with default config with Bind)? I'm tring to configure it from scratch and I don't want to make some mistakes...
Thank you so much!

Just follow the instructions from: https://www.routerperformance.net/opnsense/dnsbl-via-bind-plugin/ and don't forget to set Outbound interface to localhost in the unbound settings. That is all.
Logged

Brent Dacus

  • Newbie
  • *
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #21 on: January 20, 2019, 06:57:55 pm »
All:

Trying to configure the BIND plugin.  I have read several post and

Followed this Guide https://www.routerperformance.net/opnsense/dnsbl-via-bind-plugin/

It seems to work but I have some questions..

I also read this https://wiki.opnsense.org/manual/how-tos/bind.html

My goal is to have everything filtered and blocked. Use Unbound with forwarding. No firewall rules.  Not sure which guide to use?

What I have before Changing anything.
Systems settings general DNS server set to external dns aka 1.1.1.1, 8.8.8.8

Unbound DNS General
   enable resolver
   Network Interface ALL
   Local Zone Transparent
   Enable Forward         
   dhcp registrations and static mapping
   No custom entries
   Outgoing Network Interfaces ALL

Dhcpv4
no DNS server set forwarding Router IP as dns to clients


Questions:

This Guide https://wiki.opnsense.org/manual/how-tos/bind.html
Doesn't have a firewall rule.  It only has the Custom section.
Should I use this guide? Does this work directly with Unbound and my above setup?

I ask because when read posts I found this.
https://forum.opnsense.org/index.php?topic=10180.msg46878#msg46878
But that didnt seem to work for Mayo or Mimino
Northguy said use mimugmails guide and set localhost outgoing.  But that guide includes a firewall rule. 

Still a bit confused..

Also do I need to change any of my config above?
Logged
Thanks as always,

Brent

Qotom Q355G4 Qotom Q190G4N
Opnsense 18.7.*

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #22 on: January 20, 2019, 07:09:42 pm »
System DNS empty and Unbound outgoing Interface to localhost should be fine
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

Brent Dacus

  • Newbie
  • *
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #23 on: January 20, 2019, 07:18:21 pm »
ok so this guide
https://wiki.opnsense.org/manual/how-tos/bind.html or in general your guide with out firewall rule.

Set unbound
custom to
do-not-query-localhost: no
forward-zone:
name: „.“
forward-addr: 127.0.0.1@53530

outgoing to local

and only change
Systems settings general DNS server set to Blank


Ok here we go...
Logged
Thanks as always,

Brent

Qotom Q355G4 Qotom Q190G4N
Opnsense 18.7.*

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #24 on: January 20, 2019, 10:09:41 pm »
Bind needs acl for localhost network. Then start looking at both logs
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

Brent Dacus

  • Newbie
  • *
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #25 on: January 22, 2019, 11:57:10 pm »
All:

I sorted it.  The documentation here https://wiki.opnsense.org/manual/how-tos/bind.html
and
https://www.routerperformance.net/opnsense/dnsbl-via-bind-plugin/

Has a TYPO..

do-not-query-localhost: no
forward-zone:
name: „.“      <------------ Should be "."
forward-addr: 127.0.0.1@53530

If you copy and paste the above into the Custom section in Unboud.
It creates this in unbound.conf

# Unbound custom options
do-not-query-localhost: no
forward-zone:
name: �^`^~.�^`^|    <----------------Bad characters
forward-addr: 127.0.0.1@53530


Please use the below and retest.

do-not-query-localhost: no
forward-zone:
name: "."
forward-addr: 127.0.0.1@53530

Also Opnsense and Mimugmail please update the syntax in the Documentation.
Logged
Thanks as always,

Brent

Qotom Q355G4 Qotom Q190G4N
Opnsense 18.7.*

apiods

  • Newbie
  • *
  • Posts: 36
  • Karma: 1
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #26 on: January 23, 2019, 12:39:50 pm »
Have tried setting this up, but am getting SERVFAIL when querying unbound DNS service. I think the problem is related to:
Code: [Select]
do-not-query-localhost
I added it to the custom config, but unbound would not reload, error:
Quote
opnsense: /services_unbound.php: The command '/usr/local/sbin/unbound -c '/var/unbound/unbound.conf'' returned exit code '1', the output was '/var/unbound/unbound.conf:106: error: syntax error read /var/unbound/unbound.conf failed

Line 106 was:
Code: [Select]
do-not-query-localhost: no
Code: [Select]
Ran:  unbound-checkconf /var/unbound/unbound.conf
/var/unbound/unbound.conf:106: error: syntax error
read /var/unbound/unbound.conf failed: 1 errors in configuration file

Removed this line, and unbound started fine, but would not resolve queries, returned SERVFAIL (assume as it's not allowing lookups to localhost).

Looking at other forums, it's mentioned a few times that 'do-not-query-localhost' needs to be set in the server: section of the conf file.
In this case, it's set outside this, but if others have had it working successfully I'm wondering why it's an issue for me !

Running: OPNsense 18.7.10_3

Thanks.
Logged

Brent Dacus

  • Newbie
  • *
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #27 on: January 24, 2019, 01:18:34 am »
Quote
Have tried setting this up, but am getting SERVFAIL when querying unbound DNS service. I think the problem is related to:
Code: [Select]
do-not-query-localhost
I added it to the custom config, but unbound would not reload, error:
Quote
opnsense: /services_unbound.php: The command '/usr/local/sbin/unbound -c '/var/unbound/unbound.conf'' returned exit code '1', the output was '/var/unbound/unbound.conf:106: error: syntax error read /var/unbound/unbound.conf failed

Line 106 was:
Code: [Select]
do-not-query-localhost: no

in the custom section in unbound advanced

you need the entire section

do-not-query-localhost: no
forward-zone:
name: "."
forward-addr: 127.0.0.1@53530


Which Guide did you follow?  Guides are not very thorough. 

 
« Last Edit: January 24, 2019, 01:22:11 am by bdacus01 »
Logged
Thanks as always,

Brent

Qotom Q355G4 Qotom Q190G4N
Opnsense 18.7.*

apiods

  • Newbie
  • *
  • Posts: 36
  • Karma: 1
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #28 on: January 24, 2019, 10:00:31 am »
Quote from: bdacus01 on January 24, 2019, 01:18:34 am
you need the entire section

do-not-query-localhost: no
forward-zone:
name: "."
forward-addr: 127.0.0.1@53530


Which Guide did you follow?  Guides are not very thorough.

Sorry, it wasn't clear in my post, but I did indeed have the complete config in the custom section:

Code: [Select]
do-not-query-localhost: no
forward-zone:
name: "."
forward-addr: 127.0.0.1@53530

Then got the Unbound startup error as it didn't like "do-not-query-localhost: no". Having removed just that one line, Unbound did start okay, but would not resolve (returned SERVFAIL) - assuming because it now can't use localhost to resolve.

Quote from: bdacus01 on January 24, 2019, 01:18:34 am
Which Guide did you follow?  Guides are not very thorough.

I just used the ones mentioned in this thread:
https://wiki.opnsense.org/manual/how-tos/bind.html
https://www.routerperformance.net/opnsense/dnsbl-via-bind-plugin/

Plus the tip on this thread to configure Unbound with Outbound interface: localhost.
The guides seem pretty straight forward - I just don't understand why I seem to be the only one getting an error when using "do-not-query-localhost: no" !!
« Last Edit: January 24, 2019, 10:35:18 am by apiods »
Logged

apiods

  • Newbie
  • *
  • Posts: 36
  • Karma: 1
    • View Profile
Re: Advices to configure Unbound and Bind plugin for ad-block
« Reply #29 on: January 24, 2019, 10:34:38 am »
Quote from: apiods on January 23, 2019, 12:39:50 pm

Quote
opnsense: /services_unbound.php: The command '/usr/local/sbin/unbound -c '/var/unbound/unbound.conf'' returned exit code '1', the output was '/var/unbound/unbound.conf:106: error: syntax error read /var/unbound/unbound.conf failed

Line 106 was:
Code: [Select]
do-not-query-localhost: no

Okay ... I found the cause of my issue and "fixed" it. Unbound would not start with the custom options config in place as I also had a 'Domain Override' in place - for a sub-domain I use for testing locally.

Once I removed the Domain Override, Unbound started fine and forwarding to BIND localhost worked.
Assume it's something in the config order that Unbound does not like, as the domain override sticks a couple of lines in unbound.conf before custom options.

How can I report this as a bug ?
Logged

  • Print
Pages: 1 [2] 3
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Advices to configure Unbound and Bind plugin for ad-block
 

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