Skip to content
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

Adding DNSSEC-related RRs into inet_res and inet_dns #8727

Open
antranigv opened this issue Aug 16, 2024 · 2 comments
Open

Adding DNSSEC-related RRs into inet_res and inet_dns #8727

antranigv opened this issue Aug 16, 2024 · 2 comments
Assignees
Labels
enhancement team:PS Assigned to OTP team PS

Comments

@antranigv
Copy link

In the modern world, DNSSEC is everywhere, however, sometimes people don't implement it on their domain, which is why I was trying to create an application, where I pass it a domain and it checks for the ad flag, as well as for DNSSEC-related RR records, such as RRSIG, DS and DNSKEY.

Turns out that Erlang/OTP's inet_res does get the RRSIG records if dnssec_ok is set to true and edns is set to 0 inside of res_option(), however, the ad flag is not parsed and the RRSIG records are not recognized. all I see is type: 46.

Additionally, There is no way to send a query for the DS and DNSKEY resource records.

In an ideal world, all I need is the ad flag to be parsed (so I can make sure the DNSSEC'd response is validated by the resolver) and that the RRSIG, DS and DNSKEYs are accepted by OTP.

I'd like to implement this myself, but opening the ticket here because missed couple of things when I tried to do this :) If you can guide, I'll send a PR directly. I also wanted to confirm that I'm on the right path for adding these features.

Where are the DNS headers defined? I missed that part. There are other DNS RR types, should they be added as well? Such as SSHFP.

Thank you Erlang/OTP team!

@IngelaAndin IngelaAndin added the team:PS Assigned to OTP team PS label Aug 16, 2024
@RaimoNiskanen
Copy link
Contributor

Hi @antranigv and thank you for your interest in our DNS resolver library!

The development is largely driven by user interest, such as yours, so I will try to guide you. The resolver library is also used by our internal Ericsson customers so it is crucial to not break existing code without very good reason, which places limits on how we can do changes...

The Erlang records for DNS records are defined in lib/kernel/src/inet_dns.hrl. Here are also the record names and types defined.

Encoding is done in lib/kernel/src/inet_dns.erl. For example the #dns_rr_opt{} and #dns_rr{} records are encoded to wire format by encode_res_section/4 and helper functions such as encode_type/1. Decoding is done by decode_rr_section/5 and helper functions, in particular decode_data/3, decode_type/1 and such.

DNSSEC record would certainly be a welcome addition. We can take SSHFP at a later time - it is the first time I hear of it.

@antranigv
Copy link
Author

antranigv commented Aug 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:PS Assigned to OTP team PS
Projects
None yet
Development

No branches or pull requests

3 participants