From 1a73328a1d4e0797c1f43cf04dfacda52d780cf6 Mon Sep 17 00:00:00 2001 From: boB Rudis Date: Mon, 11 Apr 2016 09:24:02 -0400 Subject: [PATCH] hosts => entities; edns_client_subnet oversight in bulk_query() --- R/gdns.r | 19 +++++++++++++++---- man/bulk_query.Rd | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/R/gdns.r b/R/gdns.r index b2c7942..374e91d 100644 --- a/R/gdns.r +++ b/R/gdns.r @@ -74,8 +74,19 @@ query <- function(name, type="1", edns_client_subnet="0.0.0.0/0") { #' Vectorized query, returning only answers in a data frame #' -#' @param hosts character vector of hosts to query -#' @param type RR type (see \code{type} in \code{query()}). +#' @param entities character vector of entities to query +#' @param type RR type can be represented as a number in [1, 65535] or canonical +#' string (A, aaaa, etc). More information on RR types can be +#' found \href{http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4}{here}. +#' @param edns_client_subnet The edns0-client-subnet option. Format is an IP +#' address with a subnet mask. Examples: \code{1.2.3.4/24}, +#' \code{2001:700:300::/48}.\cr +#' If you are using DNS-over-HTTPS because of privacy concerns, and do +#' not want any part of your IP address to be sent to authoritative +#' nameservers for geographic location accuracy, use +#' \code{edns_client_subnet=0.0.0.0/0}. Google Public DNS normally sends +#' approximate network information (usually replacing the last part of +#' your IPv4 address with zeroes). \code{0.0.0.0/0} is the default. #' @return \code{data.frame} of only answers (use \code{query()} for detailed responses) #' @references \url{https://developers.google.com/speed/public-dns/docs/dns-over-https} #' @export @@ -85,7 +96,7 @@ query <- function(name, type="1", edns_client_subnet="0.0.0.0/0") { #' @examples #' hosts <- c("rud.is", "dds.ec", "r-project.org", "rstudio.com", "apple.com") #' gdns::bulk_query(hosts) -bulk_query <- function(hosts, type=1) { - results <- map(hosts, gdns::query, type=type) +bulk_query <- function(entities, type=1, edns_client_subnet="0.0.0.0/0") { + results <- map(entities, gdns::query, type=type, edns_client_subnet=edns_client_subnet) map_df(results, "Answer") } diff --git a/man/bulk_query.Rd b/man/bulk_query.Rd index 1cff95e..6a569d4 100644 --- a/man/bulk_query.Rd +++ b/man/bulk_query.Rd @@ -4,12 +4,24 @@ \alias{bulk_query} \title{Vectorized query, returning only answers in a data frame} \usage{ -bulk_query(hosts, type = 1) +bulk_query(entities, type = 1, edns_client_subnet = "0.0.0.0/0") } \arguments{ -\item{hosts}{character vector of hosts to query} +\item{entities}{character vector of entities to query} -\item{type}{RR type (see \code{type} in \code{query()}).} +\item{type}{RR type can be represented as a number in [1, 65535] or canonical +string (A, aaaa, etc). More information on RR types can be +found \href{http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4}{here}.} + +\item{edns_client_subnet}{The edns0-client-subnet option. Format is an IP +address with a subnet mask. Examples: \code{1.2.3.4/24}, +\code{2001:700:300::/48}.\cr +If you are using DNS-over-HTTPS because of privacy concerns, and do +not want any part of your IP address to be sent to authoritative +nameservers for geographic location accuracy, use +\code{edns_client_subnet=0.0.0.0/0}. Google Public DNS normally sends +approximate network information (usually replacing the last part of +your IPv4 address with zeroes). \code{0.0.0.0/0} is the default.} } \value{ \code{data.frame} of only answers (use \code{query()} for detailed responses)