Skip to content

rewrite adig using new helpers#607

Merged
bradh352 merged 24 commits into
c-ares:mainfrom
bradh352:adig
Nov 11, 2023
Merged

rewrite adig using new helpers#607
bradh352 merged 24 commits into
c-ares:mainfrom
bradh352:adig

Conversation

@bradh352
Copy link
Copy Markdown
Member

adig previously performed manual parsing of the DNS records. Now it can focus strictly on formatting of output data for printing. It simply iterates across the parsed DNS packet and queries for the RRs, parameters for each RR, and the datatypes for each parameter. adig will now automatically pick up new RRs from the c-ares library due to the dynamic nature.

The adig format also now more closely resembles that of BIND's dig output.

A few more helpers needed to be added to the c-ares library that were missing. There ware a couple of minor bugs and enhancements also needed.

Example:

./adig -t ANY www.google.com

; <<>> c-ares DiG 1.21.0 <<>> www.google.com
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: RCODE, id: 23913
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: 0; udp: 512	
;; QUESTION SECTION:
;www.google.com.			IN	ANY

;; ANSWER SECTION:
www.google.com.		162	IN	A	142.251.107.99
www.google.com.		162	IN	A	142.251.107.105
www.google.com.		162	IN	A	142.251.107.103
www.google.com.		162	IN	A	142.251.107.147
www.google.com.		162	IN	A	142.251.107.104
www.google.com.		162	IN	A	142.251.107.106
www.google.com.		162	IN	AAAA	2607:f8b0:400c:c32::93
www.google.com.		162	IN	AAAA	2607:f8b0:400c:c32::69
www.google.com.		162	IN	AAAA	2607:f8b0:400c:c32::68
www.google.com.		162	IN	AAAA	2607:f8b0:400c:c32::6a
www.google.com.		21462	IN	HTTPS	1 . alpn="h2,h3"

;; MSG SIZE  rcvd: 276

Fix By: Brad House (@bradh352)

@bradh352 bradh352 merged commit 956b7eb into c-ares:main Nov 11, 2023
@bradh352 bradh352 deleted the adig branch November 12, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant