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.
The manual pages
- Solnix: domainname(8) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: domainname(1) net-tools-2.10
- FreeBSD: domainname(1) 15.1-RELEASE
- OpenBSD: domainname(1) 8.0
- NetBSD: domainname(1) 11.0
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 with | Topic | What differs |
|---|---|---|
| Linux | options | Solnix 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 |
| Linux | one page, many commands | The 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 four | how the domain is set at boot | Solnix 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, NetBSD | persistence of a changed name | On 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/defaultdomain | Both 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 four | privilege to set | Solnix 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 |
| FreeBSD | NIS versus DNS domain | The 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 four | sendmail interaction | Only 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
-For-v. - Do not rely on a runtime change surviving a reboot. Persist it per system:
/etc/defaultdomainon Solnix and OpenBSD, nisdomainname in/etc/rc.confon 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.