LinuxCommandLibrary

arpaname

Translate IP address to hostname

TLDR

Translate IP addresses (IPv4 and IPv6) to the corresponding ARPA name

$ arpaname [ip_address]
copy

SYNOPSIS

arpaname <hostname_or_ip>

PARAMETERS

<hostname_or_ip>
    The input string to resolve. Can be either a hostname (e.g., "localhost") or an IPv4 address (e.g., "127.0.0.1"). The command automatically detects the type of input.

DESCRIPTION

arpaname is a lightweight command-line utility, historically part of the net-tools suite, designed for basic hostname-to-IP address or IP address-to-hostname resolution. It takes a single argument:

If the argument is a numeric IPv4 address (e.g., "127.0.0.1"), it attempts to perform a reverse DNS lookup and prints the canonical hostname. If the argument is a hostname (e.g., "localhost"), it performs a forward DNS lookup and prints the corresponding IPv4 address.

The command's name, "arpaname," reflects its original context within ARPANET-era systems, where it was intended to help services like ftp and telnet obtain host identifiers for logging purposes, although the command itself only provides standard resolution. It relies on standard system library functions like gethostbyname() and gethostbyaddr() for its resolution logic, which in turn might consult /etc/hosts or DNS. Due to its simplicity and the availability of more robust tools, arpaname is largely considered deprecated in modern Linux environments.

CAVEATS

  • arpaname is part of the net-tools package, which is largely deprecated in favor of the iproute2 suite (e.g., ip, ss).
  • It only supports IPv4 addresses and hostnames; it does not handle IPv6.
  • It provides very basic resolution functionality, lacking the advanced features and options found in modern DNS utilities like dig or host.
  • Error messages are basic (e.g., "host not found").

PURPOSE OF THE NAME

Despite its name, arpaname as a command does not output ARPANET-specific string formats (like H.L.M.N or in-addr.arpa DNS records) directly. Instead, it provides the standard hostname or IP address, which older services would then use to construct their internal ARPANET-style log entries.

DEPRECATION

This command, being part of the net-tools suite, is largely deprecated in favor of more modern and robust utilities provided by the iproute2 package (e.g., ip and ss). Users are generally advised to use host or dig for DNS lookups.

HISTORY

The arpaname utility originates from the early days of TCP/IP networking, specifically during the ARPANET era. It was developed as part of the net-tools package, which provided essential networking utilities for Unix-like systems. Its name reflects its purpose in generating or interpreting identifiers in a format relevant to the ARPANET.

For instance, services like the ftp daemon would use such resolutions to log remote host identities. With the evolution of networking and the advent of more sophisticated DNS resolution tools and the iproute2 suite, arpaname has become largely obsolete and is often not included by default in modern Linux distributions or is considered a legacy command.

SEE ALSO

host(1), dig(1), nslookup(1), gethostbyname(3), gethostbyaddr(3)

Copied to clipboard