hostname(1) on Solnix vs Linux and the BSDs

On Solnix, hostname is the illumos /usr/bin/hostname, which prints or sets the host name and has one option, -s. It lacks the Linux net-tools options (-f, -d, -i, -F and others) and the FreeBSD -f and -d options.

What Solnix runs

A default Solnix system runs the illumos hostname at /usr/bin/hostname. /usr/ucb/hostname is also shipped, but the bundle does not describe it. The Solnix page says nothing about boot-time configuration files.

Differences

Compared withTopicWhat differs
Linux-f, --fqdn, --longLinux hostname -f prints the FQDN. Solnix hostname has no -f. It accepts only -s and a name argument.
Source: Linux hostname(1) -f, --fqdn, --long; Solnix hostname(1) SYNOPSIS
Linux-d, -i, -a and -yLinux hostname has -d (DNS domain), -i (IP addresses), -a (alias), and -y/--nis (NIS domain). Solnix hostname has none of these. Scripts using them fail on Solnix.
Source: Linux hostname(1) -d, -i, -a, -y; Solnix hostname(1) OPTIONS
Linuxsetting from a fileLinux hostname -F filename reads the new host name from a file and ignores lines starting with #. Solnix hostname has no -F. The new name must be given as an argument.
Source: Linux hostname(1) -F, --file; Solnix hostname(1) SYNOPSIS
FreeBSD-f and -dFreeBSD hostname -f includes domain information and is the default. -d prints only the domain part. Solnix has neither, and the manual does not say whether its default output includes the domain.
Source: FreeBSD hostname(1) -f, -d; Solnix hostname(1) DESCRIPTION, OPTIONS
all four-s short nameSolnix -s prints only the part before the first dot. Linux, FreeBSD, OpenBSD and NetBSD document -s as trimming or cutting the domain part, so it is the portable option. Linux also accepts --short.
Source: Solnix hostname(1) -s; Linux hostname(1) -s, --short; FreeBSD hostname(1) -s; OpenBSD hostname(1) -s; NetBSD hostname(1) -s
FreeBSD, OpenBSD, NetBSDwhere the boot-time name comes fromFreeBSD sets the name from the hostname variable in /etc/rc.conf through /etc/rc.d/hostname. OpenBSD reads a myname(5) file. NetBSD uses /etc/rc.d/network. The Solnix page names no boot-time file, so setting the name by hand may not persist.
Source: FreeBSD hostname(1) DESCRIPTION; OpenBSD hostname(1) DESCRIPTION; NetBSD hostname(1) DESCRIPTION; Solnix hostname(1) DESCRIPTION
Linuxboot-time fileThe Linux page says the host name is usually set at startup from a file such as /etc/hostname. The Solnix page does not name any such file.
Source: Linux hostname(1) SET NAME; Solnix hostname(1) DESCRIPTION
Linuxrelated commandsThe Linux hostname page also covers domainname, nodename, dnsdomainname, nisdomainname and ypdomainname. The Solnix page documents only hostname. OpenBSD and NetBSD point to a separate domainname(1).
Source: Linux hostname(1) NAME; Solnix hostname(1) NAME; OpenBSD hostname(1) SEE ALSO; NetBSD hostname(1) SEE ALSO
OpenBSD, NetBSDsame synopsisOpenBSD and NetBSD hostname have the same synopsis as Solnix: hostname [-s] [name-of-host]. Only the boot-time mechanism differs.
Source: Solnix, OpenBSD and NetBSD hostname(1) SYNOPSIS

Standards

  • POSIX: hostname is not a POSIX.1-2024 utility.
  • FreeBSD: The HISTORY section says hostname appeared in 4.2BSD.
  • OpenBSD: The HISTORY section says hostname appeared in 4.2BSD.
  • NetBSD: The HISTORY section says hostname appeared in 4.2BSD.

Writing portable scripts

  • Use only hostname with no arguments, or hostname -s, in portable scripts. All five systems document -s.
  • Do not rely on hostname -f, -d or -i. They are missing on Solnix, or mean something different between Linux and FreeBSD.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.