Re: getaddrinfo and TTL

2012-08-05 Thread Martin McCormick
Phil Mayers writes:
 If you want TTL, you will need to use DNS-specific functions like the 
 res_*
 API. You need to be sure you are querying the master, otherwise the TTL
 will be the one from cache, not the real value.

I appreciate this information as it sounds like I am
using the wrong tool for the job. I only want to look up an A
record by name and have the fields in a structure, evaluate
those data and then possibly delete that record or or write a
new one that has been modified. I thought that getaddrinfo was
what I needed to use to do essentially a nslookup in C.

Martin
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: getaddrinfo and TTL

2012-08-04 Thread Phil Mayers

On 08/03/2012 05:48 PM, Martin McCormick wrote:

Can one read the TTL for a given lookup in
getaddrinfo?


I don't believe so.



Better yet, is there a listing of the entire range of
values one can read from all the structures?


The getaddrinfo() interface is specified in RFC 3493.

Specific platforms might extend the struct addrinfo (maybe?) but AFAIK 
most / all implementations just conform to the basic RFC.




I wrote an application years ago to let us change the
name of a host. The old code uses zone transfer to pull in the
whole zone, actually several zones in to a pile of A records. We
look for the old name, replace it with the new name and then do
a delete and add.


I don't understand this I'm afraid.



If getaddrinfo contains this value, the replace
application can run much faster, just doing one lookup, and the
new record we write back will keep whatever value we originally
had.


If you want TTL, you will need to use DNS-specific functions like the 
res_* API. You need to be sure you are querying the master, otherwise 
the TTL will be the one from cache, not the real value.

___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


getaddrinfo and TTL

2012-08-03 Thread Martin McCormick
Can one read the TTL for a given lookup in
getaddrinfo?

Better yet, is there a listing of the entire range of
values one can read from all the structures?

I wrote an application years ago to let us change the
name of a host. The old code uses zone transfer to pull in the
whole zone, actually several zones in to a pile of A records. We
look for the old name, replace it with the new name and then do
a delete and add.

If getaddrinfo contains this value, the replace
application can run much faster, just doing one lookup, and the
new record we write back will keep whatever value we originally
had.

Many thanks.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Telecommunications Services Group
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users