[getdns-api] Actual upstream server
Willem Toorop
willem at nlnetlabs.nl
Thu May 12 17:39:16 UTC 2016
Hi Robert,
You'll get that information when you use the call reporting extension.
willem at bonobo:~$ getdns_query -s +return_call_reporting -A nlnetlabs.nl
SYNC response:
{
"answer_type": GETDNS_NAMETYPE_DNS,
"call_reporting":
[
{
"query_name": <bindata of "nlnetlabs.nl.">,
"query_to":
{
"address_data": <bindata for 192.168.178.1>,
"address_type": <bindata of "IPv4">
},
"query_type": GETDNS_RRTYPE_AAAA,
"run_time/ms": 14,
"transport": GETDNS_TRANSPORT_UDP
},
{
"query_name": <bindata of "nlnetlabs.nl.">,
"query_to":
{
"address_data": <bindata for 192.168.178.1>,
"address_type": <bindata of "IPv4">
},
"query_type": GETDNS_RRTYPE_A,
"run_time/ms": 18,
"transport": GETDNS_TRANSPORT_UDP
}
],
"canonical_name": <bindata of "nlnetlabs.nl.">,
"just_address_answers":
[
{
"address_data": <bindata for 2a04:b900::1:0:0:10>,
"address_type": <bindata of "IPv6">
},
{
"address_data": <bindata for 185.49.140.10>,
"address_type": <bindata of "IPv4">
}
],
"replies_full":
[
<bindata of 0xbef581800001000100000000096e6c6e...>,
<bindata of 0x8e6a81800001000100000000096e6c6e...>
],
"replies_tree":
[
{
"additional": [],
"answer":
[
{
"class": GETDNS_RRCLASS_IN,
"name": <bindata of "nlnetlabs.nl.">,
"rdata":
{
"ipv6_address": <bindata for 2a04:b900::1:0:0:10>,
"rdata_raw": <bindata of 0x2a04b900000000000001000000000010>
},
"ttl": 10200,
"type": GETDNS_RRTYPE_AAAA
}
],
"answer_type": GETDNS_NAMETYPE_DNS,
"authority": [],
"canonical_name": <bindata of "nlnetlabs.nl.">,
"header":
{
"aa": 0,
"ad": 0,
"ancount": 1,
"arcount": 0,
"cd": 0,
"id": 48885,
"nscount": 0,
"opcode": GETDNS_OPCODE_QUERY,
"qdcount": 1,
"qr": 1,
"ra": 1,
"rcode": GETDNS_RCODE_NOERROR,
"rd": 1,
"tc": 0,
"z": 0
},
"question":
{
"qclass": GETDNS_RRCLASS_IN,
"qname": <bindata of "nlnetlabs.nl.">,
"qtype": GETDNS_RRTYPE_AAAA
}
},
{
"additional": [],
"answer":
[
{
"class": GETDNS_RRCLASS_IN,
"name": <bindata of "nlnetlabs.nl.">,
"rdata":
{
"ipv4_address": <bindata for 185.49.140.10>,
"rdata_raw": <bindata of 0xb9318c0a>
},
"ttl": 10200,
"type": GETDNS_RRTYPE_A
}
],
"answer_type": GETDNS_NAMETYPE_DNS,
"authority": [],
"canonical_name": <bindata of "nlnetlabs.nl.">,
"header":
{
"aa": 0,
"ad": 0,
"ancount": 1,
"arcount": 0,
"cd": 0,
"id": 36458,
"nscount": 0,
"opcode": GETDNS_OPCODE_QUERY,
"qdcount": 1,
"qr": 1,
"ra": 1,
"rcode": GETDNS_RCODE_NOERROR,
"rd": 1,
"tc": 0,
"z": 0
},
"question":
{
"qclass": GETDNS_RRCLASS_IN,
"qname": <bindata of "nlnetlabs.nl.">,
"qtype": GETDNS_RRTYPE_A
}
}
],
"status": GETDNS_RESPSTATUS_GOOD
}
Response code was: GOOD. Status was: At least one response was returned
All done.
Op 12-05-16 om 19:18 schreef Robert Groenenberg:
> Hi,
>
> I'm using getdns in stub mode with one or more upstream servers
> configured in the context.
> For statistics and logging I'd like to figure out which upstream server
> was actually used for a particular query. Am I correct that that
> information is currently not available, at least not (yet) via the API?
>
> When the user callback is invoked, does context->upstreams->current
> indicate the upstream server that responded, or could it have already
> been changed for another query that has been send out between sending
> the 'current' query and receiving its response?
>
> Thanks,
> Robert
> _______________________________________________
> spec mailing list
> spec at getdnsapi.net
More information about the Users
mailing list