Description of problem: I have configured my system as a nis client for server1.example.com. # ypwhich server1.example.com BUT : [root@station1 ~]# ypwhich -m rpc.byname localhost protocols.byname localhost services.byname localhost services.byservicename localhost netid.byname localhost passwd.byuid localhost group.bygid localhost passwd.byname localhost rpc.bynumber localhost group.byname localhost mail.aliases localhost protocols.bynumber localhost hosts.byaddr localhost hosts.byname localhost There should be the server1.example.com listed as second field here. Same for : # ypwhich -m passwd localhost Expected result: server1.example.com Version-Release number of selected component (if applicable): yp-tools-2.9-0.1 How reproducible: bind to NIS domain, call ypwhich -m or ypwhich -m passwd
Hm, works for me flawlessly. Please let me see your /etc/yp.conf, /etc/sysconfig/network and output of "domainname" command. I'm able to get different answer from "ypwhich" and "ypwhich -m" only when NIS server and client is on the same machine and client is configured with "domain X server localhost" in /etc/yp.conf. If configured with "domain X server base-os-05", then "ypwhich" and "ypwhich -m" are same. [root@base-os-05 yp]# ypwhich localhost.localdomain [root@base-os-05 yp]# ypwhich -m rpc.byname base-os-05.englab.brq.redhat.com netid.byname base-os-05.englab.brq.redhat.com services.byservicename base-os-05.englab.brq.redhat.com protocols.byname base-os-05.englab.brq.redhat.com passwd.byname base-os-05.englab.brq.redhat.com passwd.byuid base-os-05.englab.brq.redhat.com mail.aliases base-os-05.englab.brq.redhat.com ypservers base-os-05.englab.brq.redhat.com rpc.bynumber base-os-05.englab.brq.redhat.com hosts.byname base-os-05.englab.brq.redhat.com group.byname base-os-05.englab.brq.redhat.com group.bygid base-os-05.englab.brq.redhat.com services.byname base-os-05.englab.brq.redhat.com hosts.byaddr base-os-05.englab.brq.redhat.com protocols.bynumber base-os-05.englab.brq.redhat.com But that's not a bug of course.
[root@station1 ~]# egrep -v '^(#|$)' /etc/yp.conf domain notexample server 192.168.0.254 [root@station1 ~]# domainname notexample [root@station1 ~]# cat /etc/sysconfig/network NETWORKING_IPV6=yes HOSTNAME=station1.example.com NETWORKING=yes NISDOMAIN=notexample Hope that helps
I suppose that 192.168.0.254 is server1.example.com, which is different from station1.example.com. I see nothing wrong in these files. If you ypcat some map, is the result correct (I mean proper map from server1.example.com, e.g. passwd.byname)? In other words, is NIS working fine, only ypwhich shows bad server?
Yes server1.example.com is 192.168.0.254. And i do have the correct map data available. It's just the wrong server that is shown with ypwhich -m ...f
I didn't notice this behaviour during that time and I'm not able to reproduce it consciously. I configure NIS this way habitually: 1. add NISDOMAIN to /etc/sysconfig/network on the server 2. set domainname 3. run ypserv service on the server 4. run /usr/lib(64)/yp/ypinit -m on the server 5. config /etc/yp.conf (domain NISDOMAIN server SERVER) on the client 6. run ypbind service on the client 7. test ypwhich, ypwhich -m, ... on the client I didn't see any differnce between ypwhich and ypwhich -m. Do you have some certain advance how to reproduce it?
Im unable to reproduce this today. But we have changed our configuration a bit. We now employ a ypservers file on server1 - which was missing previously. [root@server1 ~]# cat /var/yp/ypservers 192.168.0.254 This my be the reason, that thinks work correctly now. [root@station12 ~]# ypwhich -m protocols.bynumber server1.example.com services.byname server1.example.com services.byservicename server1.example.com passwd.byname server1.example.com rpc.bynumber server1.example.com passwd.byuid server1.example.com protocols.byname server1.example.com hosts.byname server1.example.com rpc.byname server1.example.com mail.aliases server1.example.com group.byname server1.example.com netid.byname server1.example.com group.bygid server1.example.com hosts.byaddr server1.example.com