- stretch 232-25+deb9u11
NAME¶systemd-resolve - Resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services
systemd-resolve [OPTIONS...] HOSTNAME...
systemd-resolve [OPTIONS...] ADDRESS...
systemd-resolve [OPTIONS...] --type=TYPE DOMAIN...
systemd-resolve [OPTIONS...] --service [[NAME] TYPE] DOMAIN
systemd-resolve [OPTIONS...] --openpgp USER@DOMAIN
systemd-resolve [OPTIONS...] --tlsa DOMAIN[:PORT]
systemd-resolve [OPTIONS...] --statistics
systemd-resolve [OPTIONS...] --reset-statistics
DESCRIPTION¶systemd-resolve may be used to resolve domain names, IPv4 and IPv6 addresses, DNS resource records and services with the systemd-resolved.service(8) resolver service. By default, the specified list of parameters will be resolved as hostnames, retrieving their IPv4 and IPv6 addresses. If the parameters specified are formatted as IPv4 or IPv6 operation the reverse operation is done, and a hostname is retrieved for the specified addresses.
The program's output contains information about the protocol used for the look-up and on which network interface the data was discovered. It also contains information on whether the information could be authenticated. All data for which local DNSSEC validation succeeds is considered authenticated. Moreover all data originating from local, trusted sources is also reported authenticated, including resolution of the local host name, the "localhost" host name or all data from /etc/hosts.
The --type= switch may be used to specify a DNS resource record type (A, AAAA, SOA, MX, ...) in order to request a specific DNS resource record, instead of the address or reverse address lookups. The special value "help" may be used to list known values.
The --service switch may be used to resolve SRV and DNS-SD services (see below). In this mode, between one and three arguments are required. If three parameters are passed the first is assumed to be the DNS-SD service name, the second the SRV service type, and the third the domain to search in. In this case a full DNS-SD style SRV and TXT lookup is executed. If only two parameters are specified, the first is assumed to be the SRV service type, and the second the domain to look in. In this case no TXT RR is requested. Finally, if only one parameter is specified, it is assumed to be a domain name, that is already prefixed with an SRV type, and an SRV lookup is done (no TXT).
The --openpgp switch may be used to query PGP keys stored as OPENPGPKEY resource records. When this option is specified one or more e-mail address must be specified.
The --tlsa switch maybe be used to query TLS public keys stored as TLSA resource records. When this option is specified one or more domain names must be specified.
The --statistics switch may be used to show resolver statistics, including information about the number of successful and failed DNSSEC validations.
The --reset-statistics may be used to reset various statistics counters maintained the resolver, including those shown in the --statistics output. This operation requires root privileges.
-i INTERFACE, --interface=INTERFACE
-p PROTOCOL, --protocol=PROTOCOL
-t TYPE, --type=TYPE, -c CLASS, --class=CLASS
--set-dns=SERVER, --set-domain=DOMAIN, --set-llmnr=MODE, --set-mdns=MODE, --set-dnssec=MODE, --set-nta=DOMAIN
EXAMPLES¶Example 1. Retrieve the addresses of the "www.0pointer.net" domain
$ systemd-resolve www.0pointer.net www.0pointer.net: 2a01:238:43ed:c300:10c3:bcf3:3266:da74 220.127.116.11 -- Information acquired via protocol DNS in 611.6ms. -- Data is authenticated: no
Example 2. Retrieve the domain of the "18.104.22.168" IP address
$ systemd-resolve 22.214.171.124 126.96.36.199: gardel.0pointer.net -- Information acquired via protocol DNS in 1.2997s. -- Data is authenticated: no
Example 3. Retrieve the MX record of the "yahoo.com" domain
$ systemd-resolve -t MX yahoo.com --legend=no yahoo.com. IN MX 1 mta7.am0.yahoodns.net yahoo.com. IN MX 1 mta6.am0.yahoodns.net yahoo.com. IN MX 1 mta5.am0.yahoodns.net
Example 4. Resolve an SRV service
$ systemd-resolve --service _xmpp-server._tcp gmail.com _xmpp-server._tcp/gmail.com: alt1.xmpp-server.l.google.com:5269 [priority=20, weight=0] 188.8.131.52 alt4.xmpp-server.l.google.com:5269 [priority=20, weight=0] 184.108.40.206 ...
Example 5. Retrieve a PGP key
$ systemd-resolve --openpgp firstname.lastname@example.org d08ee310438ca124a6149ea5cc21b6313b390dce485576eff96f8722._openpgpkey.fedoraproject.org. IN OPENPGPKEY mQINBFBHPMsBEACeInGYJCb+7TurKfb6wGyTottCDtiSJB310i37/6ZYoeIay/5soJjlMyf MFQ9T2XNT/0LM6gTa0MpC1st9LnzYTMsT6tzRly1D1UbVI6xw0g0vE5y2Cjk3xUwAynCsSs ...
Example 6. Retrieve a TLS key ("=tcp" and ":443" could be skipped)
$ systemd-resolve --tlsa=tcp fedoraproject.org:443 _443._tcp.fedoraproject.org IN TLSA 0 0 1 19400be5b7a31fb733917700789d2f0a2471c0c9d506c0e504c06c16d7cb17c0 -- Cert. usage: CA constraint -- Selector: Full Certificate -- Matching type: SHA-256
SEE ALSO¶systemd(1), systemd-resolved.service(8), systemd.dnssd(5), systemd-networkd.service(8)
- Link-Local Multicast Name Resolution
- Multicast DNS