What is the difference between the ip address of
hostname -i, and the output of
ip addr??, and what ip address of
hostname -i is used for?
-i, --ip-address Display the network address(es) of the host name. Note that this works only if the host name can be resolved. Avoid using this option; use hostname --all-ip-addresses instead.
This takes the hostname, performs a DNS lookup of that hostname, and displays the corresponding address.
ip addr will give you a full list of all interface, all IPs, aliases (if any), along with mac, state and so on.