systemd-resolve
Resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services
- Provided by: systemd (Version: 229-4ubuntu21.31)
- Report a bug
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 RRDOMAIN...
systemd-resolve [OPTIONS...] --service [[NAME] TYPE] DOMAIN
systemd-resolve [OPTIONS...] --statistics
systemd-resolve [OPTIONS...] --reset-statistics
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 --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[1] and DNS-SD[2] 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 --statistics switch may be used to show resolver statistics, including information about the number of succesful 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.
-4, -6
-i INTERFACE, --interface=INTERFACE
-p PROTOCOL, --protocol=PROTOCOL
-t TYPE, --type=TYPE, -c CLASS, --class=CLASS
--service
--service-address=BOOL
--service-txt=BOOL
--cname=BOOL
--search=BOOL
--legend=BOOL
--statistics
--reset-statistics
-h, --help
--version
Example 1. Retrieve the addresses of the "www.0pointer.net" domain
$ systemd-resolve www.0pointer.net
Example 2. Retrieve the domain of the "85.214.157.71" IP address
$ systemd-resolve 85.214.157.71
Example 3. Retrieve the MX record of the "0pointer.net" domain
$ systemd-resolve -t MX 0pointer.net
Example 4. Resolve an SRV service
$ systemd-resolve --service _xmpp-server._tcp gmail.com