Setting domain name/nis domainname permanently
Setting domain name/nis domainname permanently
Setting the domain name using the command "domainname example.com" or the NIS domain name using "nisdomainname example.com" works fine but how do I set them permanently? Entering DOMAINNAME=example.com or NISDOMAIN=example.com in /etc/sysconfig/network (as it was in CentOS 6) has no effect.
Re: Setting domain name/nis domainname permanently
NIS is a complete mystery to me but how does this relate to the hostname? Perhaps hostnamectl is what you're after on CentOS 7?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Setting domain name/nis domainname permanently
"hostnamectl" lets me set the hostname of the client but neither the domain name nor the NIS domainname...
-
- Posts: 1
- Joined: 2014/07/10 01:49:01
Re: Setting domain name/nis domainname permanently
try to edit file: /etc/hostname
add the name of your host, ex: cent7
add the name of your host, ex: cent7
Re: Setting domain name/nis domainname permanently
Doesn't work. The command "domainname" still gives me "(none)" and the output of "ypdomainname" is still "ypdomainname: Local domain name not set"thanhtaolao wrote:try to edit file: /etc/hostname
add the name of your host, ex: cent7
Re: Setting domain name/nis domainname permanently
I solved it by entering the following into /etc/sysctl.conf:
kernel.domainname=example.com
It sets the domain name and NIS domain name permanently.
kernel.domainname=example.com
It sets the domain name and NIS domain name permanently.
-
- Posts: 3
- Joined: 2014/10/24 10:42:20
- Location: Taipei, Taiwan
Re: Setting domain name/nis domainname permanently
I've just found that the service "rhel-domainname" reads /etc/sysconfig/network for the NISDOMAIN line, but is NOT enabled.
But there's a bug in the .service file that will stop the system from booting if enabled:
https://admin.fedoraproject.org/updates ... .51-2.fc20
So, add the line:
DefaultDependencies=no
in the [Unit] section of /usr/lib/systemd/system/rhel-domainname.service
and then simply:
systemctl enable rhel-domainname
will do the trick and make it work as before.
The steps above has been tested with initscripts-9.49.17-1.el7_0.1 on CentOS 7.
But there's a bug in the .service file that will stop the system from booting if enabled:
https://admin.fedoraproject.org/updates ... .51-2.fc20
So, add the line:
DefaultDependencies=no
in the [Unit] section of /usr/lib/systemd/system/rhel-domainname.service
and then simply:
systemctl enable rhel-domainname
will do the trick and make it work as before.
The steps above has been tested with initscripts-9.49.17-1.el7_0.1 on CentOS 7.