Linux command
domainname 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show current NIS domain name
domainname
Set NIS domain name
sudo domainname [example.com]
Set NIS domain name from a file
sudo domainname -F [/etc/nisdomain]
Clear domain name
sudo domainname ""
说明
domainname displays or sets the system's NIS (Network Information Service) domain name. This is different from the DNS domain name and is used for NIS/YP services. Without arguments, it shows the current NIS domain. With an argument, it sets the domain name (requires root privileges). The setting is typically not persistent across reboots without additional configuration.
参数
- -v, --verbose
- Be verbose about actions.
- -F _file_, --file _file_
- Read domain name from the specified file.
- -y, --yp, --nis
- Display the NIS domain name (default behavior when invoked as domainname).
- -h, --help
- Display help and exit.
- -V, --version
- Show version information and exit.
FAQ
What is the domainname command used for?
domainname displays or sets the system's NIS (Network Information Service) domain name. This is different from the DNS domain name and is used for NIS/YP services. Without arguments, it shows the current NIS domain. With an argument, it sets the domain name (requires root privileges). The setting is typically not persistent across reboots without additional configuration.
How do I run a basic domainname example?
Run `domainname` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -v, --verbose do in domainname?
Be verbose about actions.