Unbound leaks all subnets

Started by Voodoo, June 03, 2021, 09:58:22 PM

Previous topic - Next topic
I noticed unbound leaks all subnets configured in opnsense.

Just query the firewall host, can be easily found out with a ptr lookup.

Is there some way to prevent unbound from returning all the addresses ?



# check dns server
user@docker1:~# nslookup docker1
Server:         192.168.1.1 <- used dns server
Address:        192.168.1.1#53

Name:   docker1.example.com
Address: 192.168.1.11

# ptr on dns server
user@docker1:~# nslookup 192.168.1.1
1.1.168.192.in-addr.arpa        name = firewall1.example.com.

# get all subnets
user@docker1:~# nslookup firewall1.example.com
Server:         192.168.1.1
Address:        192.168.1.1#53

Name:   firewall1.example.com
Address: 192.168.1.1
Name:   firewall1.example.com
Address: 192.168.2.1
Name:   firewall1.example.com
Address: 192.168.3.1
... (removed entries)
Name:   firewall1.example.com
Address: 10.10.1.0
Name:   firewall1.example.com
Address: 10.20.2.0
Name:   firewall1.example.com
Address: 10.20.0.2
... (removed entries)
Name:   firewall1.example.com
Address: 2a02:****
Name:   firewall1.example.com
Address: 2a02:****
Name:   firewall1.example.com
Address: 2a02:****
... (removed entries)




Woo, I've noticed the same.
Running OPNsense through Proxmox
4 x Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (1 Socket)
24 GB RAM

June 10, 2021, 09:23:08 AM #2 Last Edit: June 10, 2021, 06:33:27 PM by pmhausen
Quote from: Voodoo on June 03, 2021, 09:58:22 PM
I noticed unbound leaks all subnets configured in opnsense.
And this is a problem, because ...?

Quote from: Voodoo on June 03, 2021, 09:58:22 PM
Is there some way to prevent unbound from returning all the addresses ?
It's the built-in default behavior and there to my knowledge no option to disable it. If you need more granular control about the contents of your local DNS zones, you can replace Unbound with the BIND plugin and configure all entries manually. You lose the automatic creation of entries for DHCP clients, though.

HTH,
Patrick
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)


If you care deeply about this behaviour you will have to use different DNS services for different subnets depending on their trust level.


Cheers,
Franco

I wouldn't call it a leak. Its the normal function of a DNS resolver/server. If you don't want that every subnet should have its own DNS Server as @franco said.
(Unoffial Community) OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support

Quote from: pmhausen on June 10, 2021, 09:23:08 AM
Quote from: Voodoo on June 03, 2021, 09:58:22 PM
I noticed unbound leaks all subnets configured in opnsense.
And this is a problem, because ...?

Never said it's a problem, I just dislike it. There is simply no reason to leak all networks.

I setup a floating rule, changed unbound to only listen on a single interface and changed the dns via dhcp.


Can you please elaborate - and what was the end result?
Running OPNsense through Proxmox
4 x Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (1 Socket)
24 GB RAM

Firewall -> Rules -> Floating: pass port 53 tcp/udp source any dest 192.168.1.1

Services -> Unbound -> General: Network Interfaces: only select lan (192.168.1.1)

Services -> Unbound -> Access Lists: Allow 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8

Services -> DHCPv4 -> Set each interface dns to 192.168.1.1

Repeat for ipv6


This way only 192.168.1.1 is returned for a dns request to the firewall.

Hi Voodoo,

Perhaps it is good idea to change the Subject of your first post in this thread (insert [solved] or something similar) to mark this thread containing to solution for  this topic.

Kind Regards
Thomas
Don't forget to [applaud] those offering time and brainpower to help you!