Simple command line utility to make DNS lookups to the specified server
Simple command line utility to make DNS lookups to the specified server
Simple command line utility to make DNS lookups. Supports all known DNS protocols: plain DNS, plain DNS-over-TCP, DoH, DoT, DoQ, DNSCrypt.
Using homebrew:
brew install ameshkov/tap/dnslookupFrom source:
go install github.com/ameshkov/dnslookup@latestYou can get a binary from the releases page.
You can install it from the Snap Store
Plain DNS, use default system resolver:
dnslookup example.orgPlain DNS:
dnslookup example.org 94.140.14.14Plain DNS-over-TCP:
dnslookup example.org tcp://94.140.14.14DNS-over-TLS:
dnslookup example.org tls://dns.adguard-dns.comDNS-over-TLS with IP:
dnslookup example.org tls://dns.adguard-dns.com 94.140.14.14DNS-over-HTTPS with HTTP/2:
dnslookup example.org https://dns.adguard-dns.com/dns-queryDNS-over-HTTPS with HTTP/3 support (the version is chosen automatically):
HTTP3=1 dnslookup example.org https://dns.google/dns-queryDNS-over-HTTPS forcing HTTP/3 only:
# Google DNS
dnslookup example.org h3://dns.google/dns-queryDNS-over-HTTPS with IP:
dnslookup example.org https://dns.adguard-dns.com/dns-query 94.140.14.14DNS-over-HTTPS with basic auth (supported by AdGuard DNS):
dnslookup example.org https://username:[email protected]/dns-queryDNSCrypt (stamp):
dnslookup example.org sdns://AQIAAAAAAAAAFDE3Ni4xMDMuMTMwLjEzMDo1NDQzINErR_JS3PLCu_iZEIbq95zkSV2LFsigxDIuUso_OQhzIjIuZG5zY3J5cHQuZGVmYXVsdC5uczEuYWRndWFyZC5jb20DNSCrypt (parameters):
dnslookup example.org 176.103.130.130:5443 2.dnscrypt.default.ns1.adguard.com D12B:47F2:52DC:F2C2:BBF8:9910:86EA:F79C:E449:5D8B:16C8:A0C4:322E:52CA:3F39:0873DNS-over-QUIC:
# AdGuard DNS
dnslookup example.org quic://dns.adguard-dns.com
# Quad9
dnslookup example.org quic://9.9.9.9Sending a PTR query for an IPv4 address (IP address is recognized automatically when RRTYPE is not specified):
dnslookup 8.8.8.8Sending a PTR query for an IPv6 address (IP address is recognized automatically when RRTYPE is not specified):
dnslookup 2606:4700:4700::1111Machine-readable format:
JSON=1 dnslookup example.org 94.140.14.14Disable certificates verification:
VERIFY=0 dnslookup example.org tls://127.0.0.1Specify the type of resource record (default A):
RRTYPE=AAAA dnslookup example.org tls://127.0.0.1
RRTYPE=HTTPS dnslookup example.org tls://127.0.0.1Specify the class of query (default IN):
CLASS=CH dnslookup example.org tls://127.0.0.1Set DNSSEC DO bit in the request's OPT record:
DNSSEC=1 dnslookup example.org tls://8.8.8.8Specify EDNS subnet:
SUBNET=1.2.3.4/24 dnslookup example.org tls://8.8.8.8Add EDNS0 Padding:
PAD=1 dnslookup example.org tls://127.0.0.1Specify EDNS option with code point code and optionally payload of value as
a hexadecimal string: EDNSOPT=code:value. Example (equivalent of dnsmasq's
--add-cpe-id=12345678):
EDNSOPT=65074:3132333435363738 RRTYPE=TXT dnslookup o-o.myaddr.l.google.com tls://8.8.8.8Combine multiple options:
RRTYPE=TXT SUBNET=1.1.1.1/24 PAD=1 dnslookup o-o.myaddr.l.google.com tls://8.8.8.8Verbose-level logging:
VERBOSE=1 dnslookup example.org tls://dns.adguard-dns.comNo open issues yet, or sync has not completed.