diff options
author | Galen Guyer <galen@galenguyer.com> | 2022-07-24 21:55:12 -0400 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2022-07-24 21:55:12 -0400 |
commit | bff76b1ba1a842cd36cd24b85a43163f64af3bfe (patch) | |
tree | 0ce0c3f403581c87cdb9bf097816a9395563046a | |
parent | 79e154135540ff964fcb00585f140a67fd9a26b6 (diff) |
implement TXT records
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 68ba070..e37544e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ use std::sync::{Arc, Mutex}; use std::time::Instant; use tokio::net::UdpSocket; use trust_dns_proto::op::{Message, MessageType, ResponseCode}; -use trust_dns_proto::rr::rdata::SOA; +use trust_dns_proto::rr::rdata::{SOA, TXT}; use trust_dns_proto::rr::{DNSClass, Name, RData, Record, RecordType}; use trust_dns_proto::udp::UdpStream; use trust_dns_proto::xfer::SerialMessage; @@ -216,6 +216,9 @@ async fn handle_message( None } }, + RecordType::TXT => { + Some(RData::TXT(TXT::new(vec![r.content.clone()]))) + } RecordType::SOA => match parse_soa(&r.content) { Ok(soa) => Some(RData::SOA(soa)), Err(_) => { |