zmap / zdns

Fast DNS Lookup Library and CLI Tool
Apache License 2.0
935 stars 122 forks source link

Add structures for EDNS and NSID option #342

Closed bayerhonza closed 1 year ago

bayerhonza commented 1 year ago

Hello,

I added some structures and tests to show data included in EDNS such as client subnet (source scope filled by the resolver), NSID, and extended DNS errors. Now this information appears in the result JSON object in this form:

echo "dnssec.fail" | ./zdns --name-servers 1.1.1.1  a 

results in:

{"data":{"additionals":[{"ede":{"error_text":"DNSKEY Missing","extra_text":"no SEP matching the DS found for dnssec.fail.","info_code":9},"flags":"","type":"EDNS0","udpsize":1232,"version":0}],"protocol":"udp","resolver":"1.1.1.1:53"},"name":"dnssec.fail","status":"SERVFAIL","timestamp":"2023-07-01T10:00:00+00:00"}

Feel free to accept this pull request if you think it would be appreciated.