-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Example for raw dns query? #15
Comments
Will do! As a hint for now: |
Thanks. How about sending an Update and waiting for a response? How does that fit into the existing library? |
It doesn’t fit too well at this point. If your updates are reasonably simple, you can probably do the sending using UDP sockets yourself taking inspiration from domain-resolv/src/stub/net/udp.rs. If you don’t need fail-over, it’ll be even more simple. |
Ok, thanks. I'll homebrew something. I want to add a timeout on the response too so I know to try another server. I'm going to run into this with Push Notifications too. They don't always look like queries but they are Messages. |
Also, FYI, Push Notifications don't always get a response. |
I feel like UPDATE support would be a good feature for a separate module. It may also be a good reason to factor out the networking code into its own module rather than have it in the resolver. This currently is an issue with async functions not working in |
Also interested in an example ... |
I’ve added an example in #65 and, incidentally, also found an issue with starting the runtime. I’ll release a new version of |
Is there simple way to use also async version of raw queries? I have made this function: use domain::resolv::StubResolver;
use domain::base::question::Question;
use domain::base::name;
async fn get_root_soa(resolver: &StubResolver) {
let root = name::Dname::root();
let question = Question::new_in(root, Rtype::Soa);
match resolver.query(question).await {
Ok(answer) => {
match answer.answer() {
Ok(rrset) => println!("Root soa answer: {:?}", rrset),
Err(err) => println!("Error decoding root SOA answer: {}", err),
};
},
Err(err) => {
println!("Root soa resolution failed!");
}
};
} But rust compiler complains with:
I hoped Dname is just implementation detail. But I don't know how to define the full type in this case. And I just used root, not any parsed domain. Could be also working asynchronous variant of sync test added? |
I would ask on better channel, but I haven't found any. Reported on #133 |
How do i get the StubResolver with the latest iteration? I'm trying to get domain records. |
@pemensik Sorry, I somehow missed your question (or maybe thought you would start a discussion as suggested in #133.) The issue with |
@sigh-gone If you don’t care about any specific configuration, |
I’m closing the issue for now. Feel free to reopen it if you have a follow-up question. |
resolve README lists “querying for raw DNS records“ as a feature but could you add an example for how this is supposed to work? Maybe TXT records would make a good example since they are specifically listed.
If not an example, maybe just some hints in this issue?
The text was updated successfully, but these errors were encountered: