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.
The manual pages
- Solnix: hostname(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: hostname(1) net-tools-2.10
- FreeBSD: hostname(1) 15.1-RELEASE
- OpenBSD: hostname(1) 8.0
- NetBSD: hostname(1) 11.0
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 with | Topic | What differs |
|---|---|---|
| Linux | -f, --fqdn, --long | Linux 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 -y | Linux 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 |
| Linux | setting from a file | Linux 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 -d | FreeBSD 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 name | Solnix -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, NetBSD | where the boot-time name comes from | FreeBSD 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 |
| Linux | boot-time file | The 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 |
| Linux | related commands | The 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, NetBSD | same synopsis | OpenBSD 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,-dor-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.