Crates.io | alookup |
lib.rs | alookup |
version | 0.2.0 |
source | src |
created_at | 2018-11-17 09:13:26.960788 |
updated_at | 2019-06-29 13:36:33.341687 |
description | Lookup IPv4 and IPv6 addresses for a hostname. |
homepage | https://github.com/stbuehler/rust-alookup |
repository | https://github.com/stbuehler/rust-alookup |
max_upload_size | |
id | 97204 |
size | 11,944 |
Lookup IPv4 and IPv6 addresses for a hostname. Only prints addresses on
stdout
(one per line), errors to stderr
, and hard errors can be
detected through inspecting the exit code.
It uses the resolv
crate (specifically the query
method), which
uses libresolv.so
which is typically configured via /etc/resolv.conf
to do DNS resolution.
Install from crates.io
with
cargo install alookup
.
alookup mail.google.com
alookup [FLAGS] <NAME>
FLAGS:
-4 Query only IPv4 records (A)
-6 Query only IPv6 records (AAAA)
-s, --sort Sort (and deduplicate) addresses
-h, --help Prints help information
-V, --version Prints version information
ARGS:
<NAME> Name to lookup
0
: success (or NODATA
). You might want to treat an empty address
set (no output) as failure too (similar to NXDOMAIN
).1
: name not found (NXDOMAIN
). If an empty address set is ok for
you, you might want to ignore this exit code.2
: SRVFAIL
, timeouts, failed parsing response, generic resolver failure...3
: failed parsing a specific answer record (might have printed
partial result, but breaks on first broken record)Other exit codes should be treated as failures too; a non-zero exit code
always should show an error on stderr
, and every time an error is
printed to stderr
there should be a non-zero exit code.