{ "name": "bind-tools", "version": "9.20.30", "summary": "BIND 9's DNS tools: dig, host and nslookup query DNS servers over UDP, TCP, TLS and HTTPS", "category": "network", "license": "MPL-2.0", "homepage": "https://www.isc.org/bind/", "source": { "url": "https://downloads.isc.org/isc/bind9/9.20.30/bind-9.20.30.tar.xz", "sha256": "9e1443a40a72a30272cbc3196d020a6b2e26937111c83e59e101e82e1e3b4fef" }, "watch": {"kind": "index", "url": "https://downloads.isc.org/isc/bind9/", "regex": "href=\"(9\\.20\\.[0-9]+)/\"", "pin": "9.20", "source": "https://downloads.isc.org/isc/bind9/{version}/bind-{version}.tar.xz"}, "deps": [ "libuv", "userspace-rcu", "libcap", "openssl", "nghttp2", "readline", "ncurses" ], "env_packages": [], "static": false, "nss": true, "check": "t=$(mktemp -d) && bin/dig -v 2>&1 | has 'DiG 9.20.30' && 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' ' elif qtype == 16:' ' txt = b\"bvs dns check\"' ' ans, an = b\"\\xc0\\x0c\" + struct.pack(\">HHIH\", 16, 1, 300, len(txt) + 1) + bytes([len(txt)]) + txt, 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/dig @127.0.0.1 -p \"$P\" +short bvs.example A | has -x 192.0.2.7 && bin/dig @127.0.0.1 -p \"$P\" +short bvs.example TXT | has -x '\"bvs dns check\"' && bin/dig @127.0.0.1 -p \"$P\" nx.example A | has 'status: NXDOMAIN' && bin/host -t A -p \"$P\" bvs.example 127.0.0.1 | has -x 'bvs.example has address 192.0.2.7' && bin/nslookup -port=\"$P\" -type=A bvs.example 127.0.0.1 | has -x 'Address: 192.0.2.7' && echo \"bind-tools 9.20.30: dig, host and nslookup asked a DNS responder on UDP port $P for an A and a TXT record and a missing name\"; r=$?; [ -f \"$t/pid\" ] && kill \"$(cat \"$t/pid\")\" 2>/dev/null; exit $r" }