mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #2619] hickory_client SyncClient AXFR request against particular server only receives a single record (SOA) #1028
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#1028
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @grifferz on GitHub (Nov 26, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2619
What is the question?
I mentioned this on Discord and so far got the feedback that my code looks correct, but I am very new to both Rust and hickory-dns so I still think I have probably misunderstood.
I have the following code to do a simple synchronous AXFR query. It works fine except for against a particular server. Against that one it only receives an answer with a single record, which is an SOA.
When I perform the same AXFR on the command line using dig that works fine.
I have put the zone contents on another server and this code doing AXFR against that works fine, so maybe it is something odd that this server is doing. But as I say, dig copes with it.
The server is not mine so I cannot easily allow you to AXFR from it. I have replicated the behaviour against this server from many different places though, and the code is very simple, so I can't see how you would get different results with the same code.
Am I doing something wrong? If not then I suppose my next step is packet dump of the query from my code and from dig.
Output:
dig output:
I note that the dig output says "messages 3" and am wondering if that has anything to do with it. When I do an axfr against other servers with dig I get "messages 1"
Am I just missing how to access these extra messages?
@grifferz commented on GitHub (Nov 26, 2024):
Perhaps it could also be significant that this server is PowerDNS whereas others I have tested against are bind9
@marcus0x62 commented on GitHub (Nov 26, 2024):
A packet capture of the AXFR transaction with dig and a separate packet capture of the AXFR using your code would be helpful to troubleshoot this.
@grifferz commented on GitHub (Nov 26, 2024):
I've just done that. From a quick glance I see that both times two responses come back. My code seems to only see the one with a single record in it and then itself tears down the TCP connection.
Separately I had also noticed that when it works my code provokes a "connection reset" log on the DNS server because it's closing the connection before the server has finished sending everything so I was going to ask about that too, but in this case it seems it is closing before actually seeing all the responses it asked for.
Anyway:
https://strugglers.net/~andy/tmp/hickory.pcap
https://strugglers.net/~andy/tmp/dig.pcap
Unless you want me to export these in some other format for here?
@grifferz commented on GitHub (Nov 27, 2024):
I've found another PowerDNS operator who was willing to allow me to AXFR and that behaves the same: my code above gets a single response that contains just an SOA record. dig gets everything and says "messages 3" at the end.
@bluejekyll commented on GitHub (Nov 27, 2024):
For zone transfers you want to use this method on the client, query expects only a single response. hopefully this just works, https://docs.rs/hickory-client/latest/hickory_client/client/trait.Client.html#method.zone_transfer
@grifferz commented on GitHub (Nov 27, 2024):
Yes, that works as I expect now, thank you!
How I got to where I was:
queryand saw that its parameterquery_typewas of typeRecordTypeRecordType::AXFRI thought that was what I should use and tried itI should have read further and seen
zone_transfer.Maybe the documentation of
querycould say that it is for single responses, not for things like AXFR which may have multiple responses? I don't know if you'd want to be bolder than that and explicitly denyquery_typeof AXFR there.@bluejekyll commented on GitHub (Mar 2, 2025):
I think maybe we should have an error on query with AXFR, that probably makes sense.