query: Perform DNS over HTTPS queries using Google

Description Usage Arguments Details Value References Examples

View source: R/gdns.r

Description

Traditional DNS queries and responses are sent over UDP or TCP without encryption. This is vulnerable to eavesdropping and spoofing (including DNS-based Internet filtering). Responses from recursive resolvers to clients are the most vulnerable to undesired or malicious changes, while communications between recursive resolvers and authoritative nameservers often incorporate additional protection.

To address this problem, Google Public DNS offers DNS resolution over an encrypted HTTPS connection. DNS-over-HTTPS greatly enhances privacy and security between a client and a recursive resolver, and complements DNSSEC to provide end-to-end authenticated DNS lookups.

Usage

1
query(name, type = "1", edns_client_subnet = "0.0.0.0/0")

Arguments

name

item to lookup. Valid characters are numbers, letters, hyphen, and dot. Length must be between 1 and 255. Names with escaped or non-ASCII characters are not supported. Internationalized domain names must use the punycode format (e.g. "xn--qxam").

If an IPv4 string is input, it will be transformed into a proper format for reverse lookups.

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 here. You can use 255 for an ANY query.

edns_client_subnet

The edns0-client-subnet option. Format is an IP address with a subnet mask. Examples: 1.2.3.4/24, 2001:700:300::/48.
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 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). 0.0.0.0/0 is the default.

Details

To perform vectorized queries with only answers (and no metadata) use bulk_query()).

Value

a list with the query result or NULL if an error occurred

References

https://developers.google.com/speed/public-dns/docs/dns-over-https

Examples

1
2
3
4
5
6
query("rud.is")
query("example.com", "255") # ANY query
query("microsoft.com", "MX")
query("google-public-dns-a.google.com", "TXT")
query("apple.com")
query("17.142.160.59", "PTR")

hrbrmstr/gdns documentation built on July 3, 2017, 10:31 p.m.