3

I know that dig queries the DNS server in the /etc/resolv.conf but I read that the difference between dig and nslookup is that dig uses OS resolver libraries. But what are the OS resolver libraries?

dr_
  • 28,763
  • 21
  • 89
  • 133

1 Answers1

2

OS resolver libraries are functions (mainly gethostbyname() and gethostbyaddr()) which are part of the C library and which allow to resolve hostnames to IP addresses. To do so, they use the configuration file /etc/nsswitch.conf to decide whether they must resort to DNS, NIS, or to a simple hosts lookup file.

On the other hand, nslookup uses its own internal resolver. For some time this command used to be deprecated.

Related question: dig vs nslookup

dr_
  • 28,763
  • 21
  • 89
  • 133