Hostname - System Name Utility
Show or modify the system's hostname. The hostname identifies the machine on the network and is used in shell prompts, logs, and network services.
Usage
hostname-tool [options] [new-hostname]
Running without arguments displays the current hostname. Provide a new hostname to change it (requires root privileges).
Examples
# Display current hostname
hostname-tool
# Show fully qualified domain name
hostname-tool --fqdn
# Display IP address associated with hostname
hostname-tool --ip-address