1

In my /etc/nsswitch.conf have I set

hosts: files nis dns

With

ypwhich
ypcat hosts
ypcat passwd

can I verify that passwd and group are retrieved over NIS.

Question

How do I verify that DNS is working in NIS, as ping gets it DNS from /etc/resolve.conf and not NIS?

Sandra
  • 10,303
  • 38
  • 112
  • 165

1 Answers1

3

Normally ping and other commands to need host name resolving are linked to libc and should follow the order you demanded in /etc/nsswitch.conf and use /etc/hosts and NIS before resolving to dns.

nslookup and dig always consult DNS and never use the entries in /etc/hosts or NIS.

getent hosts <hostname | ip-address> will use the C resolver functions, honours nsswitch.conf and will show entries from your hosts file or the NIS directory before trying dns to lookup that hostname or ip-address

HBruijn
  • 77,029
  • 24
  • 135
  • 201