Skip to content

Commit

Permalink
feat: use name server reply (SOA) if record answer is empty
Browse files Browse the repository at this point in the history
If the answer is empty digs will display nothing. Instead of this
behavior, digs will show the default reply of DNS name server which
is a SOA record.

Other DNS command-line client such as `dig` and `dog` also has this
behavior.
  • Loading branch information
azzamsa committed Feb 22, 2021
1 parent 4ce3318 commit 2e93189
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ fn main() {
res.rdata().to_string().bold()
);
}
for res in res.name_servers() {
let rr_type = res.rr_type().to_string().green().bold();

println!(
" {0: <15} {1: <15} {2: <10}",
rr_type.to_string(),
res.name().to_string().blue(),
res.rdata().to_string().bold()
);
}
}
}
}
Expand Down

0 comments on commit 2e93189

Please sign in to comment.