From c498b08b5caf9f6032d931aba0a45d1b73c08ac3 Mon Sep 17 00:00:00 2001 From: Ishan Jain Date: Tue, 12 Dec 2023 04:15:37 +0530 Subject: [PATCH] debug: dns proxy --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index eeea4e4..baf8e51 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,8 @@ fn main() { println!("Received {} bytes from {}", size, source); let received_data = &buf[0..size]; + println!("{:0x?}", received_data); + upstream_socket .send_to(received_data, resolver) .expect("error in sending data to upstream"); @@ -52,6 +54,10 @@ fn main() { recv_packet.header.authority_records = 0; recv_packet.header.additional_records = 0; + for question in recv_packet.questions.iter() { + println!("{}", question.name); + } + recv_packet.answers = upstream_packet.answers; let mut response = vec![];