NIS Config how to set nisdomain name and dns name in centos 7

Hi Friends

I am trying to configure NIS master in test server. I am using centos 7.
/usr/lib64/yp/ypinit -m
The local host’s domain name hasn’t been set. Please set it.

I am trying to set NISDOMAIN name in /etc/sysconfig/network but same error is coming again and again.

Please help , how to set dnsname and nisdomain name in centos 7

Thanks
Jagamohan

Hi

Configure the /etc/hosts file, add hostname to the hosts file

#vim /etc/hosts

XX.XX.XX.XX(ip add)          fqdn                hostname

And also check the configuration file /etc/yp.conf, NIS Server also needs to be set up as a client. Edit the /etc/yp.conf file and add the following line:

# vim /etc/yp.conf

domain DOMAIN-NAME server 127.0.0.1

(or)##any one of these##

ypserver 127.0.0.1
1 Like

Hey @Jagamohan_Mohapatra!

It is as @raghuu pointed out. You have to edit the /etc/hosts file in order to set the name of the server. This is for Domain Name Server resolution, but it is not a DNS exactly. Just for local resolution.

In the oder hand you can also execute the following command line to change the hostname:

# hostnamectl set-hostname (Server's name)

Example:

# hostnamectl set-hostname rhcsa.domain.com

Hope it helps you!

Regards!
Jose Rios

You need to edit common /etc/hosts file instead of it
Add the following line there:

127.0.0.1 your-server-name