- 123
The hostname command in Linux is used to view or set the system's hostname or NIS (Network Information System) domain name. A hostname is a unique name assigned to a computer on a network to identify it. This command is essential for network management and troubleshooting.
Basic Usage
To display the current hostname, simply type:
hostnameOptions and Examples
Display Alias Name
To get the alias name of the host system (if any):
hostname -aDisplay All FQDNs
To get all Fully Qualified Domain Names (FQDNs) of the host system:
hostname -ASet Hostname
To set a new hostname temporarily:
sudo hostname new-hostnameTo set a hostname from a file (requires superuser):
sudo hostname -F filenameDisplay Domain Name
To get the domain name of the host:
hostname -dDisplay FQDN
To get the Fully Qualified Domain Name (FQDN):
hostname -fDisplay IP Addresses
To get the IP address of the host:
hostname -iTo get all IP addresses:
hostname -IDisplay Short Hostname
To get the short hostname (the part before the first dot):
hostname command in Linux with examples - GeeksforGeeks
仅显示来自 geeksforgeeks.org 的搜索结果Network Information Service
Linux is a very popular operating system. Many people use it. Developers and …
Domain Name System
The client machine sends a request to the local name server, which, if the root …
Uname Command in Linux W…
Linux, renowned for its open-source flexibility and powerful performance, …
Host Command in Linux W…
hostname command in Linux is used to obtain the DNS (Domain Name System) …
Linux hostname命令教程:如何显示或设置主机名(附实例详解和 …
How to Use the hostname Command in Linux - phoenixNAP
hostname(1) — Linux manual page - man7.org
Linux查看主机名和IP,详解使用hostname命令 - Labno3
2021年8月4日 · 在本指南中,详细记录了如何在Linux/Unix系统上使用hostname命令,检索和设置当前系统的主机、域名或节点名称。 主机名是很重要的,因为大多数网络程序都会使用它们来识别你的机器。
Linux Command hostname
- 其他用户还问了以下问题
hostname 命令,Linux hostname 命令详解:显示和设置系统的主 …
The “hostname” Command in Linux [12 Practical …
2024年4月28日 · In Linux, the hostname command is a helpful tool to change the hostname and perform modifications related to the hostname. It also helps to see the DNS (Domain Name System) and NIS (Network Information Service) …
Master the Hostname Command in Linux: A Complete Guide for …
Demystified: A Complete Guide to the Linux "hostname" …
- 某些结果已被删除