This effectively means that `doggo @2001:DB8::53 example.org` works just
like we know it from `dig(1)`. This already works for IPv4 because
`url.Parse` accepts a literal IPv4 address, but not a literal IPv6
address (due to parsing ambiguities with strings that look like an IPv4
address I guess).
This is implemented by checking if the nameserver argument is a valid IP
if the URL validation failed. If that's the case, `ns` is returned
directly with the `[2001:DB8::53]:53` as address (from
`net.JoinHostPort` with the default DNS port) and UDP as protocol (also
the default if not specified).
This patch implements the error exit code for "No reply from server"
that dig uses to indicate that it was unable to resolve an address due
to the inability to reach any resolver.
References:
https://linux.die.net/man/1/dig
I think "resolver for" should be changed to "query to" if I understand correctly.
Some other minor adjustments that make the help file terminology a bit more uniform.
Based on a report `doggo txt google.com @udp://1.1.1.1` failed.
This record had 704 bytes as the message length however the response
gets truncated if it exceeds 512 bytes with UDP.
`dig` transparently fallbacks to `tcp`, so this commit adds the same
mechanism.
- Eliminate frontend JS build step completely:
(remove dep: NodeJS, npx, tailwind, postcss, autoprefixer)
- Declutter and cleanup index.html (8.49 KB to 3.4 KB) = ~60% savings.
- Replace tailwind with custom CSS (10.64 KB to 1.96 KB) = ~81% savings.
- Remove Google font (~100 KB) as there is very little text on the page.
- Refactor and cleanup main.js and remove tailwind styling logic.
(2.82 KB to 1.12 KB) = ~60% savings.
- Net static asset reduction = 21.95 KB to 6.48 KB = ~70% savings
apart from the 100+ KB elimination of Google fonts.