Besides DoT (as mentioned by other users here), the latest version of dig
also supports DoH query by using the +https
flag.
+https[=value], +nohttps
This option indicates whether to use DNS over HTTPS (DoH) when querying name
servers. When this option is in use, the port number defaults to 443. The
HTTP POST request mode is used when sending the query.
If value is specified, it will be used as the HTTP endpoint in the query URI;
the default is /dns-query. So, for example, dig @example.com +https will use
the URI https://example.com/dns-query.
Example,
dig @cloudflare-dns.com +https foobar.com
By declaring +https
, dig
will query the provided DNS server domain (cloudflare-dns.com
) with HTTPS on port 443 to the default endpoint /dns-query
.
Effectively the above command will send a DoH (POST) request about foobar.com
to:
There are options to switch to GET request, declare a different endpoint and etc. Read the man page of these query options related to DoH:
+https
+https-get
+https-post
+http-plain
+http-plain-get
+http-plain-post