API for getting list of nameservers used in system

57 Views Asked by At

Is there a way (API) to get list of nameservers on Linux except of well known res_(n)init?

options:

  • use of .nscount and .nsaddr_list[] after res_(n)init() call
  • parsing resolv.conf on your own
  • ???

trying to find a more-less portable way to get NSes

0

There are 0 best solutions below