The hostname command in Linux is mainly used to display and set the host name of the system. If you want to modify the host name, it is best to use this command. Let's learn together.
We run directly hostname can view the current host name, hostname you want to view the other command parameters, run the hostname -h as follows:
code is as follows:
Usage : hostname [-v] {hostname|
-F file} set hostname (from file)
domainname [-v] {nisdomain|
-F file} set NIS domainname (from file)
hostname [-v] [-d|
-f|
-s|
-a|
-i|
-y|
-n] display formatted name
hostname [-v] display hostname "/p" "p"hostname -V|
–version|
-h|
–help print info and exit "/p" "p"dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y"/p" "p"-s, –short short host name
-a, –alias alias names
-i, –ip-address addresses for the hostname
-f, –fqdn, –long long host name (FQDN )
-d, –domain DNS domain name
-y, –yp, –nis NIS/YP domainname
-F, –file read hostname Or NIS domainname from given file "/p" "p" This command can read or set the hostname or the NIS domainname. You can
also read the DNS domain or the FQDN (fully qualified domain name).
unless you are using bind or NIS for host lookups you can change the
FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
part of the FQDN) in the /etc/hosts file.
See the usage of -v? The command to modify the host name is as follows:
The code is as follows:
hostname -v new hostname
The above is the method of using the hostname command to modify the host name under Linux. Use this command to view the Linux host, and then modify the host name in the combined parameters, is not very convenient, so give it a try.
The Ubuntu system cannot correctly type using the Pinyin input method. The words displayed on the in
There are many commands on Linux systems that allow users to create new directories
Linux users often use the scp and sftp commands when transferring remote files. How
The sql.sql file in Linux system has a large number of data records, sometimes incl
How to use NTP server under Linux system?
How can I handle the fdisk command in RedHat system without using all partitions?
Linux how to use cp command guide
Ubuntu download and install j2ee development environment steps
Ways to debug network performance using tools under Linux
Linux method for building pipe pipeline functions
Linux VirtualBox installation Win8.1 error 0x000000C4 how to do?
Linux installation and deployment of LXC method details
Linux system shell command tutorial
How to bind multiple network cards to one under Linux?
How to deal with the database disappeared after modifying the root password of mysql under Linux?
Google also has a developer conference: to make Android cross-platform big one
Win8.1 app store screenshots become bigger
Win8.1 users: What is your favorite browser?
View Windows Store Account Billing History
How to uninstall the Win10 application comes with win10 tips
Win7 cancels the method of disabling add-ons.
No need to change the file name to prevent IIS files from being downloaded