domainname(8) on Solnix vs Linux and the BSDs

On Solnix, domainname is the illumos command at /usr/bin/domainname. It shows or sets the NIS/RPC domain name and takes no options. The domain persists across reboots only if it is saved in /etc/defaultdomain. The boot-time setting is done by an SMF service, not by an rc script or rc.conf.

What Solnix runs

A default Solnix system runs the illumos domainname at /usr/bin/domainname. No other variants are shipped. The page is in section 8 on Solnix, while the Linux and BSD pages are in section 1. The boot-time service is svc:/system/identity:domain, managed with svcadm(8) and queried with svcs(1).

Differences

Compared withTopicWhat differs
LinuxoptionsSolnix domainname takes only an optional domain name and has no options. The Linux page documents -v, -F/--file, and the hostname-style display options. Linux -F reads the new name from a file, and a Linux script using -F or -v fails on Solnix.
Source: Solnix domainname(8) SYNOPSIS; Linux domainname(1) SYNOPSIS, -F, -v
Linuxone page, many commandsThe Linux page covers hostname, dnsdomainname, domainname, nisdomainname, nodename and ypdomainname together. The Solnix page covers only domainname. The bundle does not show nisdomainname or ypdomainname on Solnix.
Source: Linux domainname(1) NAME; Solnix domainname(8) NAME
all fourhow the domain is set at bootSolnix sets the domain at boot through the SMF service svc:/system/identity:domain. FreeBSD uses the nisdomainname variable in /etc/rc.conf. OpenBSD reads /etc/defaultdomain at boot via rc(8). NetBSD uses /etc/rc.d/network. The Linux page names no boot file.
Source: Solnix domainname(8) DESCRIPTION, NOTES; FreeBSD domainname(1) DESCRIPTION; OpenBSD domainname(1) DESCRIPTION; NetBSD domainname(1) DESCRIPTION
FreeBSD, NetBSDpersistence of a changed nameOn Solnix, a domain name that is not saved in /etc/defaultdomain reverts to the old one after reboot. The FreeBSD and NetBSD pages tie persistence to rc.conf or the network rc script, and mention no /etc/defaultdomain.
Source: Solnix domainname(8) DESCRIPTION (/etc/defaultdomain); FreeBSD domainname(1) DESCRIPTION; NetBSD domainname(1) DESCRIPTION
OpenBSD/etc/defaultdomainBoth Solnix and OpenBSD use /etc/defaultdomain. The OpenBSD page says the superuser sets the domain by supplying that file, used at boot by rc(8). The Solnix page says the file saves the name across reboots, and the SMF service sets it at boot.
Source: OpenBSD domainname(1) DESCRIPTION; Solnix domainname(8) DESCRIPTION
all fourprivilege to setSolnix requires root or an equivalent role (see rbac(7)) to set the domain. The Linux, FreeBSD, OpenBSD and NetBSD pages say only super-user or root.
Source: Solnix domainname(8) DESCRIPTION; Linux domainname(1) SET NAME; FreeBSD, OpenBSD, NetBSD domainname(1) DESCRIPTION
FreeBSDNIS versus DNS domainThe FreeBSD page warns that the YP/NIS domain name need not match the DNS domain name. The Solnix page describes the name as the NIS domain used in RPC exchanges and by naming services, and does not mention DNS.
Source: FreeBSD domainname(1) NOTES; Solnix domainname(8) DESCRIPTION
all foursendmail interactionOnly the Solnix page describes sendmail use. Solaris sendmail calls domainname if the first lookup of the fully qualified host name fails, which avoids the 60-second sleep that sendmail.org sendmail takes. The other pages say nothing of this.
Source: Solnix domainname(8) DESCRIPTION (sendmail paragraphs)

Standards

  • POSIX: domainname is not a POSIX.1-2024 utility.
  • Solnix: The bundle's Solnix page has no STANDARDS or ATTRIBUTES section.

Writing portable scripts

  • Use domainname with no options to read the NIS domain, and domainname name to set it as root. Do not use Linux -F or -v.
  • Do not rely on a runtime change surviving a reboot. Persist it per system: /etc/defaultdomain on Solnix and OpenBSD, nisdomainname in /etc/rc.conf on 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.