0

I am working on a project with android phones(language C) and I am using getaddrinfo() to check that the phone is able to speak to the nameserver assigned to it. But I think getaddrinfo is reading the cached values from resolv.conf. How can I send out dns query everytime I use getaddrinfo(). A related question : How often is the resolv.conf file updated? Note : If I am wrong in anything please point me out, I will correct it.

Thank you

mbpram
  • 1
  • 1
  • "How often is the resolv.conf file updated?" between "never" and "every time a DHCP lease is requested" – Deleted User Jul 22 '14 at 20:03
  • Bushmills thank you for the reply. I am still trying to find out if getaddrinfo sends out DNS query everytime it is called? – mbpram Jul 24 '14 at 23:25
  • it will have to, if OS stub resolver is used. "cached values from resolv.conf" are only cached by a nameserver, resolv.conf just lists which one (recursive nameserver or caching forwarder) to use. If that server has the record it is queried for cached, it has no need to recurse or forward the query. From the description: "Internally, the function needs to perform some form of DNS lookup by calling other, lower level function like gethostbyname()" - So it's DNS unless another mechanism satisfies the lookup (/etc/hosts, LDAP, NIS ...) – Deleted User Jul 24 '14 at 23:52

0 Answers0