Skip to content

DNSDB RRset lookups

RRset lookups query DNSDB’s RRset index, which supports “forward” lookups based on the owner name of an RRset.

/dnsdb/v2/lookup/rrset/TYPE/VALUE/RRTYPE/BAILIWICK

Both TYPE and VALUE are required; RRTYPE and BAILIWICK are optional. If RRTYPE is not specified, the query functions as if “ANY” was specified.

The TYPE parameter specifies how VALUE is interpreted:

TypeDescription
nameThe VALUE is a DNS owner name in presentation format or wildcards as described below. We sometimes call this just an rrset search.
rawThe VALUE is an even number of hexadecimal digits specifying a raw octet string.

Wildcards come in two forms:

  • Left-hand wildcard (*.example.com): Matches any RRsets whose owner names end with the given domain name
  • Right-hand wildcard (www.example.*): Matches any RRsets whose owner names start with the given label(s)

The OWNER_NAME and BAILIWICK are DNS names specified in DNS presentation format. RRTYPE is specified as a DNS RRtype mnemonic.

The RRtype ANY is modified from its usual meaning:

  • A DNSDB lookup for RRtype ANY matches any RRtype except DNSSEC-related RRtypes: DS, RRSIG, NSEC, DNSKEY, NSEC3, NSEC3PARAM, DLV, CDS, CDNSKEY, and TA
  • The pseudo-mnemonic ANY-DNSSEC returns only those DNSSEC-related records
  • RRtype ANY may be specified for RRTYPE to perform bailiwick filtering without filtering on a particular RRtype

The BAILIWICK may not be specified with raw queries.

The results of an rrset lookup return zero or more RRsets, along with the following metadata for each result:

ItemDescription
countThe number of times the RRset was observed via passive DNS replication.
bailiwickThe “bailiwick” of an RRset in DNSDB observed via passive DNS replication is the closest enclosing zone delegated to a nameserver which served the RRset.

The “bailiwick” of an RRset in DNSDB observed in a zone file is simply the name of the zone containing the RRset.
first seenA UTC timestamp with seconds granularity indicating the first time an RRset was seen in the given bailiwick via passive DNS replication.
last seenA UTC timestamp with seconds granularity indicating the last time an RRset was seen in the given bailiwick via passive DNS replication.
first seen in zone fileA UTC timestamp with seconds granularity indicating the first time an RRset was seen in the given bailiwick via zone file import.
last seen in zone fileA UTC timestamp with seconds granularity indicating the last time an RRset was seen in the given bailiwick via zone file import.

Results are returned in JSON Lines format with the following keys:

KeyDescription
rrnameThe owner name of the RRset in DNS presentation format.
rrtypeThe resource record type of the RRset, either using the standard DNS type mnemonic, or an RFC 3597 generic type, i.e. the string TYPE immediately followed by the decimal RRtype number.
rdataAn array of one or more Rdata values. The Rdata values are converted to the standard presentation format based on the rrtype value. If the encoder lacks a type-specific presentation format for the RRset’s rrtype, then the RFC 3597 generic Rdata encoding will be used.
bailiwickThe “bailiwick” metadata value described above.
countThe number of times the RRset was observed via passive DNS replication.
time_first, time_lastUNIX epoch timestamps with second granularity indicating the first and last times the RRset was observed via passive DNS replication. Will not be present if the RRset was only observed via zone file import.
zone_time_first, zone_time_lastUNIX epoch timestamps with second granularity indicating the first and last times the RRset was observed via zone file import. Will not be present if the RRset was only observed via passive DNS replication.
Terminal window
curl -H "Accept: application/x-ndjson" -H "X-API-Key: $DNSDB_API_KEY" \
"https://api.dnsdb.info/dnsdb/v2/lookup/rrset/name/www.farsightsecurity.com?limit=2"

Response:

{"cond": "begin"}
{"obj":{"count":5059,"time_first":1380139330,"time_last":1427881899,
"rrname":"www.farsightsecurity.com.","rrtype":"A","bailiwick":"farsightsecurity.com.",
"rdata":["66.160.140.81"]}}
{"obj":{"count":17381,"time_first":1427893644,"time_last":1468329272,
"rrname":"www.farsightsecurity.com.","rrtype":"A","bailiwick":"farsightsecurity.com.",
"rdata":["104.244.13.104"]}}
{"cond": "limited", "msg": "Result limit reached"}

Example 2: Lookup all NS RRsets ending in farsightsecurity.com

Section titled “Example 2: Lookup all NS RRsets ending in farsightsecurity.com”
Terminal window
curl -H "Accept: application/x-ndjson" -H "X-API-Key: $DNSDB_API_KEY" \
"https://api.dnsdb.info/dnsdb/v2/lookup/rrset/name/*.farsightsecurity.com/ns/farsightsecurity.com"

Response:

{"cond": "begin"}
{"obj":{"count":51,"time_first":1372688083,"time_last":1374023864,
"rrname":"farsightsecurity.com.","rrtype":"NS","bailiwick":"farsightsecurity.com.",
"rdata":["ns.lah1.vix.com.","ns1.isc-sns.net.","ns2.isc-sns.com.",
"ns3.isc-sns.info."]}}
{"obj":{"count":495241,"time_first":1374096380,"time_last":1468324876,
"rrname":"farsightsecurity.com.","rrtype":"NS","bailiwick":"farsightsecurity.com.",
"rdata":["ns5.dnsmadeeasy.com.","ns6.dnsmadeeasy.com.","ns7.dnsmadeeasy.com."]}}
{"cond": "succeeded"}
Terminal window
curl -H "Accept: application/x-ndjson" -H "X-API-Key: $DNSDB_API_KEY" \
"https://api.dnsdb.info/dnsdb/v2/lookup/rrset/name/*.farsightsecurity.com/ANY-DNSSEC?limit=2"

Response:

{"cond": "begin"}
{"obj":{"count":1696,"zone_time_first":1374250920,"zone_time_last":1521734545,
"rrname":"farsightsecurity.com.","rrtype":"DS","bailiwick":"com.",
"rdata":["60454 5 2 3672C35CFA8FF14C9C223B84277BD645C0AF54BAD5790375FE797161E4801479"]}}
{"obj":{"count":3,"zone_time_first":1374250920,"zone_time_last":1374423636,
"rrname":"farsightsecurity.com.","rrtype":"RRSIG","bailiwick":"com.",
"rdata":["DS 8 2 86400 1374774350 1374165350 8795 com.
cuOdo+2G0yJpBN5ba2zxiljSzgtTzminrVc3CrsNxQPqc5YVQX4eBWMB
+kpgSEXPT+DF2D9HwIsPpBDNdJekBpXIRW41Yl7IdZYHySqabn7hgt9M
mk5KNy9gqCOK/JLRs07LPAm3wvfyYer8e0/7VCTEjF9/DMbMGsLLH3xr kBA="]}}
{"cond": "limited", "msg": "Result limit reached"}

Example 4: Raw query for records under fsi.io

Section titled “Example 4: Raw query for records under fsi.io”
Terminal window
curl -H "Accept: application/x-ndjson" -H "X-API-Key: $DNSDB_API_KEY" \
"https://api.dnsdb.info/dnsdb/v2/lookup/rrset/raw/0366736902696f00?limit=2"

Response:

{"cond": "begin"}
{"obj":{"count":10392,"time_first":1381265499,"time_last":1428418529,
"rrname":"fsi.io.","rrtype":"A","bailiwick":"fsi.io.","rdata":["66.160.140.76"]}}
{"obj":{"count":69435,"time_first":1428433465,"time_last":1538014110,
"rrname":"fsi.io.","rrtype":"A","bailiwick":"fsi.io.","rdata":["104.244.13.104"]}}
{"cond": "limited", "msg": "Result limit reached"}