On FreeBSD, MacOS and OpenBSD, hostname -i does not work:
$ target/debug/coreutils hostname -i
hostname: failed to resolve socket addresses: failed to lookup address information: no address associated with name
In src/uu/hostname/src/hostname.rs, there is a comment that proposes to use dns-lookup crate to do this DNS request (hostname -> IP addrs).
I have a local branch using dns-lookup crate for hostname -i => works on OpenBSD :)
$ uname -a
OpenBSD openbsd-dev.home.lan 7.5 GENERIC.MP#170 amd64
$ target/debug/coreutils hostname
openbsd-dev.home.lan
$ target/debug/coreutils hostname -i
10.0.2.15
Thus, I propose to use dns-lookup for hostname tool and to push a PR for it. Agree ?