{"id":327,"date":"2019-10-21T19:47:07","date_gmt":"2019-10-21T17:47:07","guid":{"rendered":"http:\/\/linuxboxen2.dk\/?p=327"},"modified":"2019-10-21T19:47:07","modified_gmt":"2019-10-21T17:47:07","slug":"org_hostname","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=327","title":{"rendered":"HOSTNAME"},"content":{"rendered":"<p>HOSTNAME(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Linux System Administrator&#8217;s Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HOSTNAME(1)<\/p>\n<p>NAME<\/p>\n<p>hostname &#8211; show or set the system&#8217;s host name<br \/>\ndnsdomainname &#8211; show the system&#8217;s DNS domain name<br \/>\ndomainname &#8211; show or set the system&#8217;s NIS\/YP domain name<br \/>\nnisdomainname &#8211; show or set system&#8217;s NIS\/YP domain name<br \/>\nnodename &#8211; show or set the system&#8217;s DECnet node name<br \/>\nypdomainname &#8211; show or set the system&#8217;s NIS\/YP domain name<\/p>\n<p>SYNOPSIS<\/p>\n<p>hostname [-v] [-s|&#8211;short]<\/p>\n<p>hostname [-v] [-a|&#8211;alias] [-d|&#8211;domain] [-f|&#8211;fqdn|&#8211;long]<br \/>\n[-i|&#8211;ip-address]<\/p>\n<p>hostname [-v] [-y|&#8211;yp|&#8211;nis] [-n|&#8211;node]<\/p>\n<p>hostname [-v] [-F filename|&#8211;file filename] [newname]<\/p>\n<p>domainname [-v] [-F filename|&#8211;file filename] [newname]<\/p>\n<p>nodename [-v] [-F filename|&#8211;file filename] [newname]<\/p>\n<p>hostname [-v|&#8211;verbose] [-h|&#8211;help] [-V|&#8211;version]<\/p>\n<p>dnsdomainname [-v]<br \/>\nnisdomainname [-v]<br \/>\nypdomainname [-v]<\/p>\n<p>DESCRIPTION<\/p>\n<p>Hostname is the program that is used to either set or display the<br \/>\ncurrent host, domain or node name of the system.\u00a0 These names are<br \/>\nused by many of the networking programs to identify the machine. The<br \/>\ndomain name is also used by NIS\/YP.<\/p>\n<p>GET NAME<br \/>\nWhen called without any arguments, the program displays the current<br \/>\nnames:<\/p>\n<p>hostname will print the name of the system as returned by the<br \/>\ngethostname(2) function.<\/p>\n<p>domainname, nisdomainname, ypdomainname will print the name of the<br \/>\nsystem as returned by the getdomainname(2) function. This is also<br \/>\nknown as the YP\/NIS domain name of the system.<\/p>\n<p>nodename will print the DECnet node name of the system as returned by<br \/>\nthe getnodename(2) function.<\/p>\n<p>dnsdomainname will print the domain part of the FQDN (Fully Qualified<br \/>\nDomain Name). The complete FQDN of the system is returned with<br \/>\nhostname &#8211;fqdn.<\/p>\n<p>SET NAME<br \/>\nWhen called with one argument or with the &#8211;file option, the commands<br \/>\nset the host name, the NIS\/YP domain name or the node name.<\/p>\n<p>Note, that only the super-user can change the names.<\/p>\n<p>It is not possible to set the FQDN or the DNS domain name with the<br \/>\ndnsdomainname command (see THE FQDN below).<\/p>\n<p>The host name is usually set once at system startup by reading the<br \/>\ncontents of a file which contains the host name, e.g.<br \/>\n\/etc\/hostname).<\/p>\n<p>THE FQDN<br \/>\nYou can&#8217;t change the FQDN (as returned by hostname &#8211;fqdn) or the DNS<br \/>\ndomain name (as returned by dnsdomainname) with this command. The<br \/>\nFQDN of the system is the name that the resolver(3) returns for the<br \/>\nhost name.<\/p>\n<p>Technically: The FQDN is the canonical name returned by<br \/>\ngethostbyname2(2) when resolving the result of the gethostname(2)<br \/>\nname. The DNS domain name is the part after the first dot.<\/p>\n<p>Therefore it depends on the configuration (usually in \/etc\/host.conf)<br \/>\nhow you can change it. If hosts is the first lookup method, you can<br \/>\nchange the FQDN in \/etc\/hosts.<\/p>\n<p>OPTIONS<\/p>\n<p>-a, &#8211;alias<br \/>\nDisplay the alias name of the host (if used).<\/p>\n<p>-d, &#8211;domain<br \/>\nDisplay the name of the DNS domain (this is the FQDN without<br \/>\nthe segment up to the first dot). This is equivalent to using<br \/>\nthe dnsdomainname command.<\/p>\n<p>-F, &#8211;file filename<br \/>\nRead the new host name from the specified file. Comments<br \/>\n(lines starting with a `#&#8217;) are ignored.<\/p>\n<p>-f, &#8211;fqdn, &#8211;long<br \/>\nDisplay the FQDN (Fully Qualified Domain Name). A FQDN<br \/>\nconsists of name including the DNS domain.<\/p>\n<p>-h, &#8211;help<br \/>\nPrint a usage message and exit.<\/p>\n<p>-i, &#8211;ip-address<br \/>\nDisplay the IP address(es) of the host.<\/p>\n<p>-n, &#8211;node<br \/>\nDisplay the DECnet node name. If a parameter is given (or<br \/>\n&#8211;file name ) the root can also set a new node name.<\/p>\n<p>-s, &#8211;short<br \/>\nDisplay the short host name. This is the host name cut at the<br \/>\nfirst dot.<\/p>\n<p>-V, &#8211;version<br \/>\nPrint version information on standard output and exit<br \/>\nsuccessfully.<\/p>\n<p>-v, &#8211;verbose<br \/>\nBe verbose and tell what&#8217;s going on.<\/p>\n<p>-y, &#8211;yp, &#8211;nis<br \/>\nDisplay the NIS domain name. If a parameter is given (or<br \/>\n&#8211;file name ) then root can also set a new NIS domain.<\/p>\n<p>FILES<\/p>\n<p>\/etc\/hostname \/etc\/hosts \/etc\/host.conf<\/p>\n<p>AUTHOR<\/p>\n<p>Peter Tobias, &lt;tobias@et-inf.fho-emden.de&gt;<br \/>\nBernd Eckenfels, &lt;net-tools@lina.inka.de&gt; (NIS and manpage).<br \/>\nSteve Whitehouse, &lt;SteveW@ACM.org&gt; (DECnet support and manpage).<\/p>\n<p>COLOPHON<\/p>\n<p>This page is part of the net-tools (networking utilities) project.<br \/>\nInformation about the project can be found at<br \/>\n\u27e8http:\/\/net-tools.sourceforge.net\/\u27e9.\u00a0 If you have a bug report for<br \/>\nthis manual page, see \u27e8http:\/\/net-tools.sourceforge.net\/\u27e9.\u00a0 This page<br \/>\nwas obtained from the project&#8217;s upstream Git repository<br \/>\n(git:\/\/git.code.sf.net\/p\/net-tools\/code) on 2014-12-30.\u00a0 If you dis\u2010<br \/>\ncover any rendering problems in this HTML version of the page, or you<br \/>\nbelieve there is a better or more up-to-date source for the page, or<br \/>\nyou have corrections or improvements to the information in this<br \/>\nCOLOPHON (which is not part of the original manual page), send a mail<br \/>\nto\u00a0man-pages@man7.org<\/p>\n<p>net-tools\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2013-08-29\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HOSTNAME(1)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HOSTNAME(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Linux System Administrator&#8217;s Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HOSTNAME(1) NAME hostname &#8211; show or set the system&#8217;s host name dnsdomainname &#8211; show the system&#8217;s DNS domain name domainname &#8211; show or set the system&#8217;s NIS\/YP domain name nisdomainname &#8211; show or set system&#8217;s NIS\/YP domain name nodename &#8211; show or set the system&#8217;s DECnet node name ypdomainname &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-327","post","type-post","status-publish","format-standard","hentry","category-shell"],"a3_pvc":{"activated":false,"total_views":0,"today_views":0},"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=327"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/327\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}