Skip to content

Conversation

oBusk
Copy link
Contributor

@oBusk oBusk commented May 18, 2021

I felt like it would be helpful to have a miss-cache option for the dnsping just like for dnseval.

This PR adds an option using the exact same syntax and mechanics as the same option for dnseval, to offer more flexibility to dnsdiag.

dns.flags.to_text(query.flags)), flush=True)
print("%s DNS: %s:%d, hostname: %s, force_miss: %s, proto: %s, rdatatype: %s, flags: %s" %
(__progname__, dnsserver, dst_port, qname, force_miss, proto_to_text(proto), rdatatype,
dns.flags.to_text(dns.flags.RD)), flush=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how the flags here should be done. Initially I kept the code between line 200 and 207 to create a "dummy request" that I could then use for dns.flags.to_text(dummyquery.flags) but that didn't feel very nice. So I tried to see which of the options would actually change the flags from RD, but couldn't see or think of any case that this would happen?

Tried to look at what make_query does https://github.com/rthalley/dnspython/blob/v2.1.0/dns/message.py#L1433

and also tried the options for dnsping to see if any of them changed the outgoing flags, but couldn't see it. If there is an option that changes this, please let me know.

@@ -219,6 +215,19 @@ def main():
else:
i += 1

if force_miss:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farrokhi farrokhi added this to the v2.0.3 milestone May 19, 2021
@farrokhi
Copy link
Owner

farrokhi commented Feb 1, 2023

Thanks. I need to refactor this a bit before merging. It will be merged in v2.1.0

@farrokhi farrokhi closed this in ae25da8 Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants