Editing Hostname

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{lc}} [[hostname (macOS)]] [https://man7.org/linux/man-pages/man1/hostname.1.html man]
+
{{Draft}}
 +
 
 +
* https://man7.org/linux/man-pages/man1/hostname.1.html
  
 
  hostname
 
  hostname
[[hostname --help]]
 
 
  hostname -s
 
  hostname -s
  [[hostname -f]]     ([[FQDN]])
+
  hostname -f    ([[FQDN]])
  hostname -A All long host names ([[FQDN]]s)
+
  hostname -A
  [[hostname -i]] addresses for the [[host name]]
+
  hostname -i
  [[hostname -I]] (--all-ip-addresses)
+
  hostname -I
 
 
== Help ==
 
<pre>
 
hostname --help
 
Usage: hostname [-b] {hostname|-F file}        set host name (from file)
 
      hostname [-a|-A|-d|-f|-i|-I|-s|-y]      display formatted name
 
      hostname                                display host name
 
 
 
      {yp,nis,}domainname {nisdomain|-F file}  set NIS domain name (from file)
 
      {yp,nis,}domainname                      display NIS domain name
 
 
 
      dnsdomainname                            display dns domain name
 
 
 
      hostname -V|--version|-h|--help          print info and exit
 
 
 
Program name:
 
      {yp,nis,}domainname=hostname -y
 
      dnsdomainname=hostname -d
 
 
 
Program options:
 
    -a, --alias            alias names
 
    -A, --all-fqdns        all long host names (FQDNs)
 
    -b, --boot            set default hostname if none available
 
    -d, --domain          DNS domain name
 
    -f, --fqdn, --long    long host name (FQDN)
 
    -F, --file            read host name or NIS domain name from given file
 
    -i, --ip-address      addresses for the host name
 
    -I, --all-ip-addresses all addresses for the host
 
    -s, --short            short host name
 
    -y, --yp, --nis        NIS/YP domain name
 
 
 
Description:
 
  This command can get or set the host name or the NIS domain name. You can
 
  also get 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.
 
</pre>
 
 
 
 
 
== Errors ==
 
* <code>[[hostname: you must be root to change the host name]]</code>
 
  
 
== Related terms ==
 
== Related terms ==
Line 57: Line 16:
 
* <code>[[virt-sysprep]] -d testvm --[[hostname]] testvm --enable user-account --keep-user-accounts MY_USERNAME_TO_KEEP</code>
 
* <code>[[virt-sysprep]] -d testvm --[[hostname]] testvm --enable user-account --keep-user-accounts MY_USERNAME_TO_KEEP</code>
 
* [[UTS]] [[namespace]]
 
* [[UTS]] [[namespace]]
* [[hostname (Cisco)]]
 
* <code>[[hostname:]]</code> option in [[docker compose file: docker-compose.yml]]
 
  
 
== See also ==
 
== See also ==
* {{hostname}}
 
 
* {{FQDN}}
 
* {{FQDN}}
 
* {{dig}}
 
* {{dig}}
 
+
* {{DNS}}
 +
* {{Linux}}
  
 
[[Category:Linux]]
 
[[Category:Linux]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: