Operating System - Linux
1821802 Members
3202 Online
109637 Solutions
New Discussion юеВ

How do we find the domain name on a linux machine.

 
SOLVED
Go to solution
nav882
Advisor

How do we find the domain name on a linux machine.

quick question.How do we find the domain name on a linux machine.
20 REPLIES 20
Alexander Chuzhoy
Honored Contributor

Re: How do we find the domain name on a linux machine.

If it's NIS domain - the command is `domainname`.
nav882
Advisor

Re: How do we find the domain name on a linux machine.

Pls do tel me the clear steps for setting up a NIS server
Alexander Chuzhoy
Honored Contributor
Solution

Re: How do we find the domain name on a linux machine.

The link is basically a step by step guide:
http://baheyeldin.com/linux/how-to-setup-nis-for-a-linux-network.html

It's not mentioned in the link but should be done:
start the yppasswdd service on NIS master server:
service yppasswdd start
all required service should start by default:
chkconfig ypserv on
chkconfig yppasswdd on
chkconfig ypbind on # on the client


You didn't assign points for answers you received so far. Please take the time and assign points.
nav882
Advisor

Re: How do we find the domain name on a linux machine.

hi,as u tld,i went thru the link tht u had sent
.I installed the server software on my machine and also follwed the client procedure.But how to test it now without deleting the user.or how to know tht every thing is set up properly.whn i startup the events its gettin started.whn i log on to another machine via ssh and thru tht whn i try to log on to my machine by that users name and password i cant logon.So hw to abt it.
hey and abt the point s u had told i have assigned it in my lat 2 previous post.thanks
Alexander Chuzhoy
Honored Contributor

Re: How do we find the domain name on a linux machine.

On a machine that's a client of your NIS server run a command:
`ypcat passwd`
You should see a list of all users added to the server.

A quick command to configure a station to be a NIS client:
authconfig --enablenis --nisdomain --nisserver --kickstart

And thanks for the points.
nav882
Advisor

Re: How do we find the domain name on a linux machine.

ya thnks again.The thing now is i have given the domain name as localhost.localdomain on the system i use(server) and hostname is localhost.localdomain on my machine as well as the client.These 2 files cums under /etc/sysconfig/network.
And i have edited thethe /etc/yp.conf and have entered the follwing in tht file
domain localhost.nisdomain server localhost.nisdomain

but whn i do ypbind start on client it says it failed .so wht might be the problem and how to go about it.thanks
nav882
Advisor

Re: How do we find the domain name on a linux machine.

sorry in the above posting i have used the domain name as localhost.nisdomain and hostname as localhost.localdomain
Alexander Chuzhoy
Honored Contributor

Re: How do we find the domain name on a linux machine.

Obviously choose a proper name.
localhost is resolved to 127.0.0.1, So the client tries to connect to itself instead of server.
nav882
Advisor

Re: How do we find the domain name on a linux machine.

the hostname on client machine and server is localhost.nisdomain and domain name is localhost.nisdomain (on both client and server).
On server the yp.conf is edited and ypserver 127.0.0.1 is added.But on client i have added it has domain localhost.nisdomain server 12.0.0.13 which is server(my machine s)ip.and restarted all the services on the server.so whn i say ypbind start on client it says failed.I am not sure how to figure out the problem.Also ypiniy -m i have added the localhost.nisdomain .I have give u the entire scenario.do help me out here
nav882
Advisor

Re: How do we find the domain name on a linux machine.

OR
From the above scenario can u tel me wht shd be edited on yp.conf on client side assume tht hostname on client side is linux and domain is localhost.nis domain. i.e,what shd be added to the following syntax in yp.conf file whn the server ip is 12.0.0.13
domain somedomain server somehost

and on server side is the domainname is localhost.nisdomain and the host name is server
Alexander Chuzhoy
Honored Contributor

Re: How do we find the domain name on a linux machine.

Use the following command:
A quick command to configure a station to be a NIS client:
authconfig --enablenis --nisdomain --nisserver --kickstart

It will edit the /etc/yp.conf file and restart the appropriate services.

Make sure that the firewall service isn't blocking the rpc communication. Run `service iptables stop` (at least just for the test).

The portmapper service must be running(service portmap start).
What's the output from `rpcinfo -p `, executed on the client?
nav882
Advisor

Re: How do we find the domain name on a linux machine.

sry to bug u,but u r my only go of now.

what should we give in place of in the following:
authconfig --enablenis --nisdomain --nisserver --kickstart

mydomainname(server):localhost.nisdomain
hostname=nav.com

on client domainname=localhost.nisdomain
HOSTNAME=shy.com
when i run `rpcinfo -p nav.com` it gives the following error:
rpcinfo: can't contact portmapper: RPC: Remote system error - Network is unreachable

but whn i give the ip address it gives the following:whereas the ipgiven hereis a server ip ,(executed on the client)

rpcinfo -p 12.0.0.13
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 32768 status
100024 1 tcp 32769 status
100007 2 udp 837 ypbind
100007 1 udp 837 ypbind
100007 2 tcp 840 ypbind
100007 1 tcp 840 ypbind
100009 1 udp 742 yppasswdd
100004 2 udp 757 ypserv
100004 1 udp 757 ypserv
100004 2 tcp 760 ypserv
100004 1 tcp 760 ypserv
600100069 1 udp 771 fypxfrd
600100069 1 tcp 773 fypxfrd

i think the problem is with yp.conf .I am not sure how to give the following in yp.conf provided i have given u all the info
server ip:12.0.0.13
client ip:12.0.0.10


Alexander Chuzhoy
Honored Contributor

Re: How do we find the domain name on a linux machine.

Replace the with 12.0.0.13

It will replace the lines in /etc/yp.conf file. You don't need to edit it once you use authconfig.
nav882
Advisor

Re: How do we find the domain name on a linux machine.

and what are all the options that we are suppose to choose in authconfig.
Alexander Chuzhoy
Honored Contributor

Re: How do we find the domain name on a linux machine.

This is the full command with all the required options:
authconfig --enablenis --nisdomain --nisserver --kickstart

The command must be executed on a station that will act as the client. You can also make your NIS server a client of the NIS domain it serves.

You only need to replace:
with your NIS domainname
and
with the IP of your NIS server.That's it!
Let us know if it helps.

Points assignment will be appreciated of course.
nav882
Advisor

Re: How do we find the domain name on a linux machine.

thanks,i think its working.But the thing is i havent seen any users created on my system.So I am noe deleting the user from the othr system.I think i wil figure it out from here.
Alexander Chuzhoy
Honored Contributor

Re: How do we find the domain name on a linux machine.

After creating a user on the server, run the following command:
make -C /var/yp

This will update the NIS maps and you will see the user account from the client...

nav882
Advisor

Re: How do we find the domain name on a linux machine.

k u meant tht i can c the other user acc i my home directory rit.I tried it But i still dnt c any user in my home directory.Dnt knw whts wrong now
nav882
Advisor

Re: How do we find the domain name on a linux machine.

sir can u lend me ur mail id or sumthing so tht i can be in touch with u regularly
cuteguy
New Member

Re: How do we find the domain name on a linux machine.

Simply you can use this website http://www.ip-details.com/domain-host-search/ to get the domain name by providing your ip address.....