{ "name": "drill", "version": "1.9.2", "summary": "drill: queries DNS servers like dig and follows DNSSEC chains of trust (-S, -T), from NLnet Labs' ldns", "category": "network", "license": "BSD-3-Clause", "homepage": "https://nlnetlabs.nl/projects/ldns/", "source": { "url": "https://nlnetlabs.nl/downloads/ldns/ldns-1.9.2.tar.gz", "sha256": "b524fa21994b6e834200ceb8c27f1b84bda5982fe35706f058196c079db94d5d" }, "watch": {"kind": "index", "url": "https://nlnetlabs.nl/downloads/ldns/", "regex": "ldns-([0-9]+(?:\\.[0-9]+)+)\\.tar\\.gz", "checksum": "{source}.sha256"}, "deps": [ "ldns", "openssl" ], "env_packages": [], "static": true, "nss": true, "check": "t=$(mktemp -d) && bin/drill -v | has 'drill version 1.9.2' && printf '%s\\n' 'import socket, struct, sys' 's = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)' 's.bind((\"127.0.0.1\", int(sys.argv[1])))' 'while True:' ' q, a = s.recvfrom(4096)' ' i = 12' ' while q[i]:' ' i += q[i] + 1' ' name = q[12:i + 1].lower()' ' qtype = struct.unpack(\">H\", q[i + 1:i + 3])[0]' ' question = q[12:i + 5]' ' ans, an, rcode = b\"\", 0, 0' ' if name == b\"\\x03bvs\\x07example\\x00\":' ' if qtype == 1:' ' ans, an = b\"\\xc0\\x0c\" + struct.pack(\">HHIH\", 1, 1, 300, 4) + bytes([192, 0, 2, 7]), 1' ' else:' ' rcode = 3' ' s.sendto(q[:2] + struct.pack(\">HHHHH\", 0x8180 | rcode, 1, an, 0, 0) + question + ans, a)' > \"$t/dns.py\" && P=$(free_port) && { python3 \"$t/dns.py\" \"$P\" & echo $! > \"$t/pid\"; } && for i in $(seq 1 50); do net_sockets udp udp6 | has \":$(printf '%04X' \"$P\") \" && break; sleep 0.2; done && bin/drill -p \"$P\" bvs.example A @127.0.0.1 > \"$t/a\" && has -P '^bvs\\.example\\.\\t300\\tIN\\tA\\t192\\.0\\.2\\.7$' < \"$t/a\" && has 'rcode: NOERROR' < \"$t/a\" && bin/drill -p \"$P\" nx.example A @127.0.0.1 | has 'rcode: NXDOMAIN' && echo \"drill 1.9.2: an A record and a missing name asked of a DNS responder on UDP port $P\"; r=$?; [ -f \"$t/pid\" ] && kill \"$(cat \"$t/pid\")\" 2>/dev/null; exit $r" }