After upgrading a server to RHEL6, I found that if other RHEL6 computers tried to NFS-mount a shared directory, all files were owned by nobody:nobody. To fix this, edit the file /etc/idmapd.conf and add a Domain line, something like this:

Domain = example.com

Then to make this change take effect, restart rpcidmapd.

/etc/rc.d/init.d/rpcidmapd restart

Then remount the drive or reboot. The files were owned by the corrected owner and group.

You can disable idmapping altogether on systems after RHEL6.3 with this:

NFS client 
 # echo 'Y' > /sys/module/nfs/parameters/nfs4_disable_idmapping 

NFS server
 # echo 'Y' > /sys/module/nfsd/parameters/nfs4_disable_idmapping 

NFS4 uses idmapping to make sure that exported shares have the permissions set properly. If the domains don’t match on the client and server, it just changes them to nobody:nobody.