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

Regression when using Resolver::txt_lookup #1627

Closed
glts opened this issue Feb 5, 2022 · 3 comments · Fixed by #1629
Closed

Regression when using Resolver::txt_lookup #1627

glts opened this issue Feb 5, 2022 · 3 comments · Fixed by #1629

Comments

@glts
Copy link
Contributor

glts commented Feb 5, 2022

I have been using trust_dns_resolver::Resolver::txt_lookup successfully with version 0.20.4.

The same lookup now fails with version 0.21.0-alpha.4.

To reproduce:

use trust_dns_resolver::Resolver;

fn main() {
    let resolver = Resolver::default().unwrap();

    let name = "bmc.org";
    match resolver.txt_lookup(name) {
        Ok(lookup) => {
            for txt in lookup {
                eprintln!(
                    "<{:?}>",
                    txt.iter()
                        .map(|data| String::from_utf8_lossy(data))
                        .collect::<String>()
                );
            }
        }
        Err(e) => {
            eprintln!("error: {}", e);
        }
    }
}

Output with trust-dns-resolver 0.20.4:

<"docusign=5140f07f-9f9c-4561-8a94-e69761a38442">
<"OVrFqSjwZz9OshiM1LGcVWYjzhtYrg930HlRDNn43M3PFP0Vx3XSv2w0rNxzACUUtgmhp0iXx15yK18nnl0svg==">
<"ZOOM_verify_xJpoFs3nSDywDsvmMWygGg">
<"">
<"4FVu/Fi5/VTEsxj+08airJyjv1oKUMC6yFTlOfWCg3ol7HwVAu3lmZre+8UOrQXKpzgJ1vbe/zRUepCN7cnFJg==">
<"v*spf1 include:servers.mcsv.net ?all">
<"v=spf1 a mx include:us._netblocks.mimecast.com include:spf1.service.formassembly.com -all">
<"apple-domain-verification=UnyCDv1Ozqb0yjW7">
<"docusign=2d29c1de-6a95-474d-ada4-3b7c3ee40fa8">

Output with trust-dns-resolver 0.21.0-alpha.4:

error: no record found for name: bmc.org. type: TXT class: IN

I can reproduce this on two separate hosts (home and VPS).

@bluejekyll
Copy link
Member

Thanks the for the report. I think there are two potential changes related to this: #1556 and #1562

I was able to reproduce this with the resolve command and when enabling debug, you can see that the difference between the two requests is that in the 0.20 version it fails the intial request, then reattempts with TCP. In the 0.21 (main) branch, it appears that the promotion to TCP resolution isn't attempted.

My guess is that this is due to the larger record response on all the TXT records, and it requires TCP (> 512 byte reponse).

@peterthejohnston, I think we're going to need to revisit some of those changes. @glts, thank you for finding this before we pushed the next release for 0.21.

@bluejekyll
Copy link
Member

#1629 appears to resolve this. I want to make sure that we have a test case to reproduce this before merging.

@bluejekyll
Copy link
Member

The patch for this was released today in v0.21.0-alpha.5.

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

Successfully merging a pull request may close this issue.

2 participants