summaryrefslogtreecommitdiff
path: root/ext/net
diff options
context:
space:
mode:
Diffstat (limited to 'ext/net')
-rw-r--r--ext/net/Cargo.toml4
-rw-r--r--ext/net/ops.rs9
2 files changed, 11 insertions, 2 deletions
diff --git a/ext/net/Cargo.toml b/ext/net/Cargo.toml
index f833a22e5..18e3636e3 100644
--- a/ext/net/Cargo.toml
+++ b/ext/net/Cargo.toml
@@ -20,5 +20,5 @@ log = "0.4.14"
serde = { version = "1.0.129", features = ["derive"] }
socket2 = "0.4.2"
tokio = { version = "1.17", features = ["full"] }
-trust-dns-proto = "0.20.3"
-trust-dns-resolver = { version = "0.20.3", features = ["tokio-runtime", "serde-config"] }
+trust-dns-proto = "=0.21.2"
+trust-dns-resolver = { version = "=0.21.2", features = ["tokio-runtime", "serde-config"] }
diff --git a/ext/net/ops.rs b/ext/net/ops.rs
index 0167448dd..4fef38985 100644
--- a/ext/net/ops.rs
+++ b/ext/net/ops.rs
@@ -579,6 +579,7 @@ pub enum DnsReturnRecord {
preference: u16,
exchange: String,
},
+ Ns(String),
Ptr(String),
Srv {
priority: u16,
@@ -730,6 +731,7 @@ fn rdata_to_return_record(
preference: mx.preference(),
exchange: mx.exchange().to_string(),
}),
+ NS => r.as_ns().map(ToString::to_string).map(DnsReturnRecord::Ns),
PTR => r
.as_ptr()
.map(ToString::to_string)
@@ -818,6 +820,13 @@ mod tests {
}
#[test]
+ fn rdata_to_return_record_ns() {
+ let func = rdata_to_return_record(RecordType::NS);
+ let rdata = RData::NS(Name::new());
+ assert_eq!(func(&rdata), Some(DnsReturnRecord::Ns("".to_string())));
+ }
+
+ #[test]
fn rdata_to_return_record_ptr() {
let func = rdata_to_return_record(RecordType::PTR);
let rdata = RData::PTR(Name::new());