-
-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new static zone type block_a to suppress all A queries for specific zones #819
Added new static zone type block_a to suppress all A queries for specific zones #819
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition code looks nice. This can be added to the code repository.
…hange. - Merge #819: Added new static zone type block_a to suppress all A queries for specific zones.
Thank you for the new static zone type! It is added to the code repository, nice if it can help with IPv6 deployment. |
Thank you so much for review. That's great addition to Unbound and it will definitely help to address some issues with IPv6. |
What happens with |
It will be NODATA as only NODATA is safe to return when we have no information about existence of AAAA record:
|
That's a bit problematic. Better would be to just strip it from the answer, not intercept the query. I.e. if the answer returns an IPv4 address, return NODATA instead, if the answer returns NXDOMAIN, return NXDOMAIN. Because if a client simultaneously queries for more than one resource record and the other records return NXDOMAIN, this might be very confusing and breaking DNS specifications. Simon Kelley of dnsmasq has outlined it a bit more detailed here:
|
@treysis Thank you for your feedback. I completely agree that my implementation is not ideal. NXDOMAIN is quite dangerous thing in general and for optimisation purposes many DNS providers prefer not to use it and resort to NODATA and I did the same. The main application of block_a to force application to use IPv6 address instead of IPv4 address. IPv6 addresses in AAAA records may be provided by upstream or may be synthesised using DNS64 and in this case it's very unlikely will cause serious issues as we kind of guarantee that AAAA will be here. |
* nlnet/master: Regenerate configure for the fix acx_nlnetlabs.m4 for -Wstrict-prototypes. - Fix acx_nlnetlabs.m4 for -Wstrict-prototypes. Fix NLnetLabs#833: [FR] Ability to set the Redis password. - Fix NLnetLabs#835: [FR] Ability to use Redis unix sockets. - Add NLnetLabs#835: [FR] Ability to use Redis unix sockets. Changelog note for NLnetLabs#819, generate configparser.c and comment syntax change. - Merge NLnetLabs#819: Added new static zone type block_a to suppress all A queries for specific zones. - Fix test for new default. - Set default for harden-unknown-additional to no. So that it does not hamper future protocol developments. - Add harden-unknown-additional option. Default on and it removes unknown records from the authority section and additional section. Thanks to Xiang Li, from NISL Lab, Tsinghua University. - Set max-udp-size default to 1232. This is the same default value as the default value for edns-buffer-size. It restricts client edns buffer size choices, and makes unbound behave similar to other DNS resolvers. The new choice, down from 4096 means it is harder to get large responses from Unbound. Thanks to Xiang Li, from NISL Lab, Tsinghua University. - Fix not following cleared RD flags potentially enables amplification DDoS attacks, reported by Xiang Li and Wei Xu from NISL Lab, Tsinghua University. The fix stops query loops, by refusing to send RD=0 queries to a forwarder, they still get answered from cache. Added new static zone type block_a to suppress all A queries for specific zones
Is there a good way to use this globally? |
@maurice-w , if you want global configuration you can use the following:
This will still resolve A queries but filter them out to insecure NODATA answers. |
@gthess Yes, that's how I implemented it for OPNsense. 😉 I'm currently trying to switch this to the new native block_a implementation to improve performance and reduce the memory footprint. |
@pavel-odintsov Let me rephrase the question: Would it make sense to modify the implementation of |
Hello!
I hope you're doing great. May I kindly ask to review my proposal to add new type of static zones?
Let me start from the beginning to explain reasons of adding such capability.
IPv6 deployment is one the the relatively hot trends nowadays and it's finally (after 27 years) getting traction due to clear business demands in many countries.
There are multiple vectors behind and I would like to mention few of them:
Considering all these facts I decided to speed up deployment of IPv6 for my home network and my labs and switched it into "IPv6 only mode".
Unfortunately, pretty large number of services still have no IPv6 addresses but it can be easily addressed with NAT64 gateway and custom DNS running DNS64.
So I've deployed NAT64 based on TAYGA and Unbound and most of the services just worked perfectly fine without any issues.
The main blocker level issue I faced with Signal messenger. They have really nice support for IPv6 but due to issues in NodeJS / Electron even if IPv6 / AAAA records exists it tries to contact IPv4 address from A record.
So the only way to fix Signal was to suppress A records completely and keep IPv6 records only. I've created static zone and hardcoded all their IPv6 addresses and it fixed it.
Unfortunately, such approach is not flexible and very unreliable. So I've tried to find way to suppress only A records and keep everything else as-is from their own DNS server.
That's how this implementation was born.
I've mostly copied implementation of transparent-always with very small alterations. I may be wrong in some corner cases and I appreciate careful review for it.
With this patch I have following configuration entries in my Unbound:
In future this capability may be helpful to test that specific domain can run in IPv6 only mode.
As future project I think it may be good idea to add global flag which completely blocks A queries from clients like you have for ANY query.
Thank you!