3 ms·
Making multiple DoH requests in shell script from a list of domainnames. DOH_SERVER=eu1.lavate.ch (echo example.net;echo example.org;echo example.com) > 1.
by 1vuio0pswjnm7 4y ago
Making multiple DoH requests in shell script from a list of domainnames.
DOH_SERVER=eu1.lavate.ch
(echo example.net;echo example.org;echo example.com) > 1.txt
yy048 < 1.txt|yy049|yy050|sed "s,.*,https://$DOH_SERVER?dns-query?dns=&," \
|yy025|openssl s_client -connect $DOH_SERVER:443 -ign_eof
This uses HTTP/1.1 pipelining and only a single TCP connection. Good netiquette.
Instead of openssl one can use, e.g., stunnel, or an https proxy, plus netcat.
The sources for yy025, yy048, yy049 and yy050 are just short text files compiled with flex. If preferred, yy025 can be replaced a little more shell script and tr(1).
No Ruby, no Python, no Go, or other large languages. Just shell utilities.
Parsing catenated responses can be done with ldns, e.g., drill.