client: add comments about NXDOMAIN

This commit is contained in:
Peter Cai 2021-04-04 13:30:59 +08:00
parent 4cf2b5983b
commit 309bcbdfa5
1 changed files with 2 additions and 0 deletions

View File

@ -33,6 +33,8 @@ impl Client {
match resp.header().rcode() {
Rcode::NoError => Self::extract_answers(resp),
// NXDOMAIN is not an error we want to retry / panic upon
// It simply means the domain doesn't exist
Rcode::NXDomain => Ok(Vec::new()),
rcode => Err(format!("Server error: {}", rcode)),
}