aboutsummaryrefslogtreecommitdiff
path: root/network/dog
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-01-22 09:43:10 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-01-22 11:12:27 +0700
commit16a4e7b1a54341b6f4ba4ef78a5206f684675923 (patch)
tree85ada1169c15c981ae7ff584567501ddc3ec3cb3 /network/dog
parent0a3f331722ea944525a3cbbc69ea9f987cd9d69a (diff)
network/dog: Added (DNS Lookup).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/dog')
-rw-r--r--network/dog/README5
-rw-r--r--network/dog/config.toml9
-rw-r--r--network/dog/dog.1268
-rw-r--r--network/dog/dog.SlackBuild104
-rw-r--r--network/dog/dog.info12
-rw-r--r--network/dog/slack-desc19
6 files changed, 417 insertions, 0 deletions
diff --git a/network/dog/README b/network/dog/README
new file mode 100644
index 000000000000..a1ba58f7d43e
--- /dev/null
+++ b/network/dog/README
@@ -0,0 +1,5 @@
+dog (command-line DNS client)
+
+dog is a command-line DNS client, like 'dig'. It has colourful
+output, understands normal command-line argument syntax, supports the
+DNS-over-TLS and DNS-over-HTTPS protocols, and can emit JSON.
diff --git a/network/dog/config.toml b/network/dog/config.toml
new file mode 100644
index 000000000000..8b41196d9169
--- /dev/null
+++ b/network/dog/config.toml
@@ -0,0 +1,9 @@
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source."https://github.com/llogiq/mutagen"]
+git = "https://github.com/llogiq/mutagen"
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "vendor"
diff --git a/network/dog/dog.1 b/network/dog/dog.1
new file mode 100644
index 000000000000..bf9b516b8620
--- /dev/null
+++ b/network/dog/dog.1
@@ -0,0 +1,268 @@
+.\" Automatically generated by Pandoc 3.1.6
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "dog" "1" "" "v0.1.0" ""
+.hy
+.SH NAME
+.PP
+dog \[em] a command-line DNS client
+.SH SYNOPSIS
+.PP
+\f[V]dog [options] [domains...]\f[R]
+.PP
+\f[B]dog\f[R] is a command-line DNS client.
+It has colourful output, supports the DNS-over-TLS and DNS-over-HTTPS
+protocols, and can emit JSON.
+.SH EXAMPLES
+.TP
+\f[V]dog example.net\f[R]
+Query the \f[V]A\f[R] record of a domain using default settings
+.TP
+\f[V]dog example.net MX\f[R]
+\&...looking up \f[V]MX\f[R] records instead
+.TP
+\f[V]dog example.net MX \[at]1.1.1.1\f[R]
+\&...using a specific nameserver instead
+.TP
+\f[V]dog example.net MX \[at]1.1.1.1 -T\f[R]
+\&...using TCP rather than UDP
+.TP
+\f[V]dog -q example.net -t MX -n 1.1.1.1 -T\f[R]
+As above, but using explicit arguments
+.SH QUERY OPTIONS
+.TP
+\f[V]-q\f[R], \f[V]--query=HOST\f[R]
+Host name or domain name to query.
+.TP
+\f[V]-t\f[R], \f[V]--type=TYPE\f[R]
+Type of the DNS record being queried (\f[V]A\f[R], \f[V]MX\f[R],
+\f[V]NS\f[R]\&...)
+.TP
+\f[V]-n\f[R], \f[V]--nameserver=ADDR\f[R]
+Address of the nameserver to send packets to.
+.TP
+\f[V]--class=CLASS\f[R]
+Network class of the DNS record being queried (\f[V]IN\f[R],
+\f[V]CH\f[R], \f[V]HS\f[R])
+.PP
+By default, dog will request A records using the system default
+resolver.
+At least one domain name must be passed \[em] dog will not automatically
+query the root nameservers.
+.PP
+Query options passed in using a command-line option, such as
+`\f[V]--query lookup.dog\f[R]' or `\f[V]--type MX\f[R]', or as plain
+arguments, such as `\f[V]lookup.dog\f[R]' or `\f[V]MX\f[R]'.
+dog will make an intelligent guess as to what plain arguments mean
+(\f[V]MX\f[R] is quite clearly a type), which makes it easier to compose
+ad-hoc queries quickly.
+If precision is desired, use the long-form options.
+.PP
+If more than one domain, type, nameserver, or class is specified, dog
+will perform one query for each combination, and display the combined
+results in a table.
+For example, passing three type arguments and two domain name arguments
+will send six requests.
+.PP
+DNS traditionally uses port 53 for both TCP and UDP.
+To use a resolver with a different port, include the port number after a
+colon (\f[V]:\f[R]) in the nameserver address.
+.SH SENDING OPTIONS
+.TP
+\f[V]--edns=SETTING\f[R]
+Whether to opt in to DNS.
+This can be `\f[V]disable\f[R]', `\f[V]hide\f[R]', or `\f[V]show\f[R]'.
+.TP
+\f[V]--txid=NUMBER\f[R]
+Set the transaction ID to a specific value.
+.TP
+\f[V]-Z=TWEAKS\f[R]
+Set uncommon protocol-level tweaks.
+.SH TRANSPORT OPTIONS
+.TP
+\f[V]-U\f[R], \f[V]--udp\f[R]
+Use the DNS protocol over UDP.
+.TP
+\f[V]-T\f[R], \f[V]--tcp\f[R]
+Use the DNS protocol over TCP.
+.TP
+\f[V]-S\f[R], \f[V]--tls\f[R]
+Use the DNS-over-TLS protocol.
+.TP
+\f[V]-H\f[R], \f[V]--https\f[R]
+Use the DNS-over-HTTPS protocol.
+.PP
+By default, dog will use the UDP protocol, automatically re-sending the
+request using TCP if the response indicates that the message is too
+large for UDP.
+Passing \f[V]--udp\f[R] will only use UDP and will fail in this case;
+passing \f[V]--tcp\f[R] will use TCP by default.
+.PP
+The DNS-over-TLS (DoT) and DNS-over-HTTPS (DoH) protocols are available
+with the \f[V]--tls\f[R] and \f[V]--https\f[R] options.
+Bear in mind that the system default resolver is unlikely to respond to
+requests using these protocols.
+.PP
+Note that if a hostname or domain name is given as a nameserver, rather
+than an IP address, the resolution of that host is performed by the
+operating system, \f[I]not\f[R] by dog.
+.PP
+Unlike the others, the HTTPS transport type requires an entire URL,
+complete with protocol, domain name, and path.
+.SH OUTPUT OPTIONS
+.TP
+\f[V]-1\f[R], \f[V]--short\f[R]
+Short mode: display nothing but the first result.
+.TP
+\f[V]-J\f[R], \f[V]--json\f[R]
+Display the output as JSON.
+.TP
+\f[V]--color\f[R], \f[V]--colour=WHEN\f[R]
+When to colourise the output.
+This can be `\f[V]always\f[R]', `\f[V]automatic\f[R]', or
+`\f[V]never\f[R]'.
+.TP
+\f[V]--seconds\f[R]
+Do not format durations as hours and minutes; instead, display them as
+seconds.
+.TP
+\f[V]--time\f[R]
+Print how long the response took to arrive.
+.SH META OPTIONS
+.TP
+\f[V]--help\f[R]
+Displays an overview of the command-line options.
+.TP
+\f[V]--version\f[R]
+Displays the version of dog being invoked.
+.SH ENVIRONMENT VARIABLES
+.PP
+dog responds to the following environment variables:
+.SS \f[V]DOG_DEBUG\f[R]
+.PP
+Set this to any non-empty value to have dog emit debugging information
+to standard error.
+For more in-depth output, set this to the exact string
+`\f[V]trace\f[R]'.
+.SH RECORD TYPES
+.PP
+dog understands and can interpret the following record types:
+.TP
+\f[V]A\f[R]
+IPv4 addresses
+.TP
+\f[V]AAAA\f[R]
+IPv6 addresses
+.TP
+\f[V]CAA\f[R]
+permitted certificate authorities
+.TP
+\f[V]CNAME\f[R]
+canonical domain aliases
+.TP
+\f[V]HINFO\f[R]
+system information and, sometimes, forbidden request explanations
+.TP
+\f[V]LOC\f[R]
+location information
+.TP
+\f[V]MX\f[R]
+e-mail server addresses
+.TP
+\f[V]NAPTR\f[R]
+DDDS rules
+.TP
+\f[V]NS\f[R]
+domain name servers
+.TP
+\f[V]OPT\f[R]
+extensions to the DNS protocol
+.TP
+\f[V]PTR\f[R]
+pointers to canonical names, usually for reverse lookups
+.TP
+\f[V]SOA\f[R]
+administrative information about zones
+.TP
+\f[V]SRV\f[R]
+IP addresses with port numbers
+.TP
+\f[V]SSHFP\f[R]
+SSH key fingerprints
+.TP
+\f[V]TLSA\f[R]
+TLS certificates, public keys, and hashes
+.TP
+\f[V]TXT\f[R]
+arbitrary textual information
+.PP
+When a response DNS packet contains a record of one of these known
+types, dog will display it in a table containing the type name and a
+human-readable summary of its contents.
+.PP
+Records with a type number that does not map to any known record type
+will still be displayed.
+As they cannot be interpreted, their contents will be displayed as a
+series of numbers instead.
+.PP
+dog also contains a list of record type names that it knows the type
+number of, but is not able to interpret, such as \f[V]IXFR\f[R] or
+\f[V]ANY\f[R] or \f[V]AFSDB\f[R].
+These are acceptable as command-line arguments, meaning you can send an
+AFSDB request with `\f[V]dog AFSDB\f[R]'.
+However, their response contents will still be displayed as numbers.
+They may be supported in future versions of dog.
+.SH PROTOCOL TWEAKS
+.PP
+The \f[V]-Z\f[R] command-line argument can be used one or more times to
+set some protocol-level options in the DNS queries that get sent.
+It accepts the following values:
+.TP
+\f[V]aa\f[R]
+Sets the \f[V]AA\f[R] (Authoritative Answers) bit in the query.
+.TP
+\f[V]ad\f[R]
+Sets the \f[V]AD\f[R] (Authentic Data) bit in the query.
+.TP
+\f[V]bufsize=NUM\f[R]
+Sets the UDP payload size field in the OPT field in the query.
+This has no effect if EDNS is diabled.
+.TP
+\f[V]cd\f[R]
+Sets the \f[V]CD\f[R] (Checking Disabled) bit in the query.
+.SH EXIT STATUSES
+.TP
+0
+If everything goes OK.
+.TP
+1
+If there was a network, I/O, or TLS error during operation.
+.TP
+2
+If there is no result from the server when running in short mode.
+This can be any received server error, not just NXDOMAIN.
+.TP
+3
+If there was a problem with the command-line arguments.
+.SH AUTHOR
+.PP
+dog is maintained by Benjamin `ogham' Sago.
+.PP
+\f[B]Website:\f[R] \f[V]https://dns.lookup.dog/\f[R]
+.PD 0
+.P
+.PD
+\f[B]Source code:\f[R] \f[V]https://github.com/ogham/dog\f[R]
diff --git a/network/dog/dog.SlackBuild b/network/dog/dog.SlackBuild
new file mode 100644
index 000000000000..2b5e586287f9
--- /dev/null
+++ b/network/dog/dog.SlackBuild
@@ -0,0 +1,104 @@
+#!/bin/bash
+
+# Slackware build script for dog
+
+# Written by B. Watson (urchlay@slackware.uk)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# Notes:
+
+# This is written in rust, which annoys me (not the language, but its
+# build system). Fortunately it works with the rust included in
+# Slackware 15.0 (no need for rustup).
+
+# I considered just doing a binary repack, but upstream doesn't
+# provide a 32-bit x86 binary...
+
+# The vendored sources were made thus:
+## tar xvf dog-0.1.0.tar.gz
+## cd dog-0.1.0
+## cargo vendor
+## cd ..
+## tar cvfJ dog-0.1.0-vendored-sources.tar.xz dog-0.1.0/vendor/
+# It's a bunch of .crate files, like 70 of them. I would not have
+# packaged this if I didn't have a place to host my own tarball
+# with all the vendor stuff (if I had to list 70 .crate files in
+# my .info file, I'd just forget about this).
+
+# The man page was generated with:
+## pandoc --standalone -t man /tmp/SBo/dog-0.1.0/man/dog.1.md > dog.1
+# (adapted from the Justfile)
+
+# Linode has some docs on using this:
+# https://www.linode.com/docs/guides/use-dog-linux-dns-client/
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=dog
+VERSION=${VERSION:-0.1.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+# It's in rust, we don't need any C flags. Also, no lib|lib64 here.
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION-vendored-sources.tar.xz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
+
+# Contents of config.toml came from 'cargo vendor' output.
+mkdir -p .cargo
+cat $CWD/config.toml > .cargo/config.toml
+
+# Setting CARGO_HOME prevents writing a 0-byte /root/.cargo/.package-cache
+CARGO_HOME=`pwd`/.cargo-home cargo build --release
+
+install -D -s -m0755 -oroot -groot target/release/dog $PKG/usr/bin/dog
+
+# Pregenerated (tiny) man page to avoid dependency on (huge) pandoc.
+mkdir -p $PKG/usr/man/man1
+gzip -9c < $CWD/dog.1 > $PKG/usr/man/man1/dog.1.gz
+
+# Completions for various shells. They all seem to work.
+PSH=$PKG/usr/share
+install -D -m0644 completions/dog.bash $PSH/bash-completion/completions/dog
+install -D -m0644 completions/dog.fish $PSH/fish/completions/dog.fish
+install -D -m0644 completions/dog.zsh $PSH/zsh/site-functions/_dog
+
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a README* LICENCE $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/network/dog/dog.info b/network/dog/dog.info
new file mode 100644
index 000000000000..97882692e3bd
--- /dev/null
+++ b/network/dog/dog.info
@@ -0,0 +1,12 @@
+PRGNAM="dog"
+VERSION="0.1.0"
+HOMEPAGE="https://dns.lookup.dog/"
+DOWNLOAD="https://github.com/ogham/dog/archive/v0.1.0/dog-0.1.0.tar.gz \
+ https://slackware.uk/~urchlay/src/dog-0.1.0-vendored-sources.tar.xz"
+MD5SUM="ed91c9cedc9dd9b16c179a928290ed65 \
+ 07919b78323eb5b5b22f67f11fa6b592"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="urchlay@slackware.uk"
diff --git a/network/dog/slack-desc b/network/dog/slack-desc
new file mode 100644
index 000000000000..1208e3fe2906
--- /dev/null
+++ b/network/dog/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+dog: dog (command-line DNS client)
+dog:
+dog: dog is a command-line DNS client, like 'dig'. It has colourful
+dog: output, understands normal command-line argument syntax, supports the
+dog: DNS-over-TLS and DNS-over-HTTPS protocols, and can emit JSON.
+dog:
+dog:
+dog:
+dog:
+dog:
+dog: