OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 23.1 Legacy Series »
  • Unbound DNS - Forward clients IP to ADGuard home
« previous next »
  • Print
Pages: [1]

Author Topic: Unbound DNS - Forward clients IP to ADGuard home  (Read 4999 times)

vamp

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Unbound DNS - Forward clients IP to ADGuard home
« on: July 18, 2023, 09:15:29 am »
Hello there,

I install ADGuard home a different server and now i forward all DNS request to him. The problem is that now ADGuard only show opnsense IP address and hard to filter the clients.

I read that unbound able to send client IP addresses to upstream DNS server (EDNS settings) but not found any documentation how to handle it in opnsense.

(side note, no not want to install ADGuard home direct to opnsense and also dont want to reverse the direction :) )
Logged

CJ

  • Hero Member
  • *****
  • Posts: 832
  • Karma: 30
    • View Profile
    • Have Answer, Will Blog
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #1 on: July 18, 2023, 01:52:13 pm »
How are you forwarding DNS requests?  Firewall rules?

Why don't you just set your Adguard DNS server in the DNS option of DHCP?
Logged
Have Answer, Will Blog

vamp

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #2 on: July 18, 2023, 01:57:10 pm »
Not firewall rules, i forward it with unbound.

Yes, it easier, but i try to do this way
Logged

CJ

  • Hero Member
  • *****
  • Posts: 832
  • Karma: 30
    • View Profile
    • Have Answer, Will Blog
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #3 on: July 18, 2023, 02:05:43 pm »
I'm confused.  Is there a specific purpose that you're trying to accomplish by query forwarding with Unbound instead of just providing the Adguard DNS directly to your clients?
Logged
Have Answer, Will Blog

vamp

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #4 on: July 18, 2023, 02:08:00 pm »
It is a "labor test" i try to do a same result with adguard+unbound like pihole and dnsmasq

If i follow this article, it work like a charm...

https://pi-hole.net/blog/2021/09/30/pi-hole-and-opnsense/#page-content

But if i try to "translate" it with ADguard+Unbound, no success....
Logged

CJ

  • Hero Member
  • *****
  • Posts: 832
  • Karma: 30
    • View Profile
    • Have Answer, Will Blog
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #5 on: July 18, 2023, 02:20:23 pm »
I assume because dnsmasq defaults to on while Unbound is off.

According to the docs, you can set custom options with a config file.  https://docs.opnsense.org/manual/unbound.html

Personally, I'd just pass AdGuard via DHCP.  Good luck!
Logged
Have Answer, Will Blog

vamp

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #6 on: July 18, 2023, 02:25:54 pm »
I also disabled dnsmasq and enable Unbound.

I already add custom config to unboud. This one

Code: [Select]
server:
  client-subnet-always-forward: yes
  send-client-subnet: 0.0.0.0/0
  send-client-subnet: ::0/0

But not help at all.
Logged

fbeye

  • Full Member
  • ***
  • Posts: 174
  • Karma: 1
    • View Profile
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #7 on: July 18, 2023, 04:42:15 pm »
If I am reading your original post correct, I had the same issue and created a topic and was resolved towards the bottom. Hope it helps.

https://forum.opnsense.org/index.php?topic=34129.msg165379#msg165379
Logged

vamp

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #8 on: July 18, 2023, 05:26:57 pm »
Yeah, your sollution is that revert the direction. it is that others say.

But, my idea is that configure opnsense to a DNS server (unbound or dnsmasq), and  forward DNS query to ADguard Home and also information to client IP. (it is the EDNS setting, you able to do this unbound and dnsmasq)

If i use pihole (and dnsmasq on opnsense side) it works as expected. opnsense accept dns query and forward it to pihole (pi hole is the DNS server that i set it on opnsense general setting)

It need to add this to opnsense dnsmasq setting:

Code: [Select]
add-mac
add-subnet=32,128


If i do same with onbound (it is the code that need to add it)

Code: [Select]
server:
  client-subnet-always-forward: yes
  send-client-subnet: 0.0.0.0/0
  send-client-subnet: ::0/0

not working... also pihole and ADGoard home. (AdGuard also not work with dnsmasq)

It also really important, that if use pihole need to add this settings to pihole dns server (it use dnsmasq)

Code: [Select]
strip-subnet
strip-mac

because if we not to do this, pihole forward this data to setting up DNS Server... (google or any that you set it...)

See this pull req:

https://github.com/pi-hole/FTL/pull/1240
Logged

NeoDragon

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #9 on: July 18, 2023, 06:56:04 pm »
You should remove unbound from this chain, adguard can do it all without having to use unbound.
Any way, have you tried this :

Unbound:
 DHCP Static Mappings    Register DHCP static mappings Ticked
 DHCP Registration    Register DHCP leases  Ticked

AdguardHome:
Under Upstream DNS Server (make sure it is the first entry)
[/168.192.in-addr.arpa/]192.168.1.1

Change the adress accordingly to your own network.
Logged

fbeye

  • Full Member
  • ***
  • Posts: 174
  • Karma: 1
    • View Profile
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #10 on: July 18, 2023, 09:05:34 pm »
Not trying to hijack the conversation, but add to it and gain knowledge.
When running OpenVPN clients, would there need to be special Upstream for that as well? Such as the preferred DNS servers by the VPN provider?
Logged

vamp

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: Unbound DNS - Forward clients IP to ADGuard home
« Reply #11 on: July 18, 2023, 10:06:24 pm »
hmm seems not possible to do this with unbound...

it need to manually compaile it:

https://discourse.pi-hole.net/t/unbound-with-ecs-and-dnssec/56682

I compiled unbound manually, with the --enable-subnet flag, to enable ECS support. Here is the relevant part of the config (the other 2 files are for DNSSEC, and the one from the pihole docs/guides)

Seems opnsense version not contain ECS support.

edit:

ahhhh... it never working with ADGuard home... this feaure is not implemented yet...

https://github.com/AdguardTeam/AdGuardHome/issues/1727

sad news...
« Last Edit: July 18, 2023, 10:33:37 pm by vamp »
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 23.1 Legacy Series »
  • Unbound DNS - Forward clients IP to ADGuard home
 

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