Browse Source

Fixed when nameserver list is cached; added examples

master
boB Rudis 6 years ago
parent
commit
826449c16d
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 39
      man/zdns_query.Rd

39
man/zdns_query.Rd

@ -51,3 +51,42 @@ JSON output stored in \code{output_file} and an optional \code{log} file
if you specified \code{TRUE} for \code{log} then \emph{you} are responsible for
removing the auto-generated log file.
}
\examples{
\dontrun{
# enumerate top prefixes for a domain
c(
"www", "mail", "mx", "blog", "ns1", "ns2", "dev", "server", "email",
"cloud", "api", "support", "smtp", "app", "webmail", "test", "box",
"m", "admin", "forum", "news", "web", "mail2", "ns", "demo", "my",
"portal", "shop", "host", "cdn", "git", "vps", "mx1", "mail1",
"static", "help", "ns3", "beta", "chat", "secure", "staging", "vpn",
"apps", "server1", "ftp", "crm", "new", "wiki", "home", "info"
) -> top_common_prefixes
tf <- tempfile(fileext = ".json")
zdns_query(
sprintf("\%s.rstudio.com", top_common_prefixes),
query_type = "A",
num_nameservers = (length(top_common_prefixes) * 2),
output_file = tf
)
res <- jsonlite::stream_in(file(tf))
found <- which(lengths(res$data$answers) > 0)
do.call(
rbind.data.frame,
lapply(found, function(idx) {
res$data$answers[[idx]]$query_name <- res$name[idx]
res$data$answers[[idx]]
})
) -> xdf
xdf <- xdf[,c("query_name", "name", "class", "ttl", "type", "answer")]
knitr::kable(xdf)
}
}

Loading…
Cancel
Save