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

DNS: Support for additional record types #219

Open
maxhoesel opened this issue Sep 14, 2023 · 1 comment
Open

DNS: Support for additional record types #219

maxhoesel opened this issue Sep 14, 2023 · 1 comment

Comments

@maxhoesel
Copy link

It seems like this crate currently only supports the most common DNS record types:

// in cloudflare/src/endpoints/dns.rs
pub enum DnsContent {
    A { content: Ipv4Addr },
    AAAA { content: Ipv6Addr },
    CNAME { content: String },
    NS { content: String },
    MX { content: String, priority: u16 },
    TXT { content: String },
}

However, the Cloudflare API lists several additional record types that are currently not implemented, including CAA, CERT, DNSKEY and more.

From what I can tell, adding any of these records to a zone causes the ListDnsRecords query to fail with an unknown variant error during deserialization, effectively making the ListDnsRecords query unavailable for such a zone (example below).
I'm running into this issue on my own zones, since I have a CAA record set on them.

I have a fork that fixes this for CAA records, but I'd be interested in seeing support for these record types in this main crate.
Adding simple enum variants for these records with the content field should be sufficient to allow the ListDnsRecords request to succeed (the API also returns a structured data field for some record types, but I don't think this is necessary for basic support).

If support for these record types is desired, I'd be more than happy to make the required changes and open a PR!


Steps to reproduce:

  1. Create a zone and create a CAA record through the Web Interface (such as 0 issue letsencrypt.org).
  2. Attempt to list all records in that zone using the cloudflare-examples utility like so:
cargo run -p cloudflare-examples -- --auth-token <redacted> dns <zone-id>
  1. The client will return the following error:
Error: error decoding response body: unknown variant `CAA`, expected one of `A`, `AAAA`, `CNAME`, `NS`, `MX`, `TXT`, `SRV` at line 1 column 8705
@maxhoesel maxhoesel changed the title DNS: Suuport for additional record types DNS: Suport for additional record types Sep 14, 2023
@maxhoesel maxhoesel changed the title DNS: Suport for additional record types DNS: Support for additional record types Sep 14, 2023
@taladar
Copy link

taladar commented Aug 30, 2024

I ran into that with the SSHFP record type in my zones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants