{
    "mode": "man",
    "parameter": "resolvectl",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/resolvectl/1/json",
    "generated": "2026-09-14T15:33:56Z",
    "synopsis": "resolvectl [OPTIONS...] {COMMAND} [NAME...]",
    "sections": {
        "NAME": {
            "content": "resolvectl, resolvconf - Resolve domain names, IPV4 and IPv6 addresses, DNS resource records,\nand services; introspect and reconfigure the DNS resolver\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "resolvectl [OPTIONS...] {COMMAND} [NAME...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "resolvectl may be used to resolve domain names, IPv4 and IPv6 addresses, DNS resource records\nand services with the systemd-resolved.service(8) resolver service. By default, the specified\nlist of parameters will be resolved as hostnames, retrieving their IPv4 and IPv6 addresses.\nIf the parameters specified are formatted as IPv4 or IPv6 addresses the reverse operation is\ndone, and a hostname is retrieved for the specified addresses.\n\nThe program's output contains information about the protocol used for the look-up and on\nwhich network interface the data was discovered. It also contains information on whether the\ninformation could be authenticated. All data for which local DNSSEC validation succeeds is\nconsidered authenticated. Moreover all data originating from local, trusted sources is also\nreported authenticated, including resolution of the local host name, the \"localhost\" hostname\nor all data from /etc/hosts.\n",
            "subsections": []
        },
        "COMMANDS": {
            "content": "query HOSTNAME|ADDRESS...\nResolve domain names, as well as IPv4 and IPv6 addresses. When used in conjunction with\n--type= or --class= (see below), resolves low-level DNS resource records.\n\nIf a single-label domain name is specified it is searched for according to the configured\nsearch domains — unless --search=no or --type=/--class= are specified, both of which turn\nthis logic off.\n\nIf an international domain name is specified, it is automatically translated according to\nIDNA rules when resolved via classic DNS — but not for look-ups via MulticastDNS or\nLLMNR. If --type=/--class= is used IDNA translation is turned off and domain names are\nprocessed as specified.\n\nAdded in version 239.\n\nservice [[NAME] TYPE] DOMAIN\nResolve \u001b[34mRFC 6763 DNS-SD[1] and \u001b[34mRFC 2782 SRV[2] services, depending on the specified list\nof parameters. If three parameters are passed the first is assumed to be the DNS-SD\nservice name, the second the SRV service type, and the third the domain to search in. In\nthis case a full DNS-SD style SRV and TXT lookup is executed. If only two parameters are\nspecified, the first is assumed to be the SRV service type, and the second the domain to\nlook in. In this case no TXT resource record is requested. Finally, if only one parameter\nis specified, it is assumed to be a domain name, that is already prefixed with an SRV\ntype, and an SRV lookup is done (no TXT).\n\nAdded in version 239.\n\nopenpgp EMAIL@DOMAIN...\nQuery PGP keys stored as OPENPGPKEY resource records, see \u001b[34mRFC 7929[3]. Specified e-mail\naddresses are converted to the corresponding DNS domain name, and any OPENPGPKEY keys are\nprinted.\n\nAdded in version 239.\n\ntlsa [FAMILY] DOMAIN[:PORT]...\nQuery TLS public keys stored as TLSA resource records, see \u001b[34mRFC 6698[4]. A query will be\nperformed for each of the specified names prefixed with the port and family\n(\"port.family.domain\"). The port number may be specified after a colon (\":\"), otherwise\n443 will be used by default. The family may be specified as the first argument, otherwise\ntcp will be used.\n\nAdded in version 239.\n\nstatus [LINK...]\nShows the global and per-link DNS settings currently in effect. If no command is\nspecified, this is the implied default.\n\nAdded in version 239.\n",
            "subsections": [
                {
                    "name": "statistics",
                    "content": "Shows general resolver statistics, including information whether DNSSEC is enabled and\navailable, as well as resolution and validation statistics.\n\nAdded in version 239.\n"
                },
                {
                    "name": "reset-statistics",
                    "content": "Resets the statistics counters shown in statistics to zero. This operation requires root\nprivileges.\n\nAdded in version 239.\n"
                },
                {
                    "name": "flush-caches",
                    "content": "Flushes all DNS resource record caches the service maintains locally. This is mostly\nequivalent to sending the SIGUSR2 to the systemd-resolved service.\n\nAdded in version 239.\n"
                },
                {
                    "name": "reset-server-features",
                    "content": "Flushes all feature level information the resolver learnt about specific servers, and\nensures that the server feature probing logic is started from the beginning with the next\nlook-up request. This is mostly equivalent to sending the SIGRTMIN+1 to the\nsystemd-resolved service.\n\nAdded in version 239.\n\ndns [LINK [SERVER...]], domain [LINK [DOMAIN...]], default-route [LINK [BOOL...]], llmnr\n[LINK [MODE]], mdns [LINK [MODE]], dnssec [LINK [MODE]], dnsovertls [LINK [MODE]], nta [LINK\n[DOMAIN...]]\nGet/set per-interface DNS configuration. These commands may be used to configure various\nDNS settings for network interfaces. These commands may be used to inform\nsystemd-resolved or systemd-networkd about per-interface DNS configuration determined\nthrough external means. The dns command expects IPv4 or IPv6 address specifications of\nDNS servers to use. Each address can optionally take a port number separated with \":\", a\nnetwork interface name or index separated with \"%\", and a Server Name Indication (SNI)\nseparated with \"#\". When IPv6 address is specified with a port number, then the address\nmust be in the square brackets. That is, the acceptable full formats are\n\"111.222.333.444:9953%ifname#example.com\" for IPv4 and\n\"[1111:2222::3333]:9953%ifname#example.com\" for IPv6. The domain command expects valid\nDNS domains, possibly prefixed with \"~\", and configures a per-interface search or\nroute-only domain. The default-route command expects a boolean parameter, and configures\nwhether the link may be used as default route for DNS lookups, i.e. if it is suitable for\nlookups on domains no other link explicitly is configured for. The llmnr, mdns, dnssec\nand dnsovertls commands may be used to configure the per-interface LLMNR, MulticastDNS,\nDNSSEC and DNSOverTLS settings. Finally, nta command may be used to configure additional\nper-interface DNSSEC NTA domains.\n\nCommands dns, domain and nta can take a single empty string argument to clear their\nrespective value lists.\n\nFor details about these settings, their possible values and their effect, see the\ncorresponding settings in systemd.network(5).\n\nAdded in version 239.\n\nrevert LINK\nRevert the per-interface DNS configuration. If the DNS configuration is reverted all\nper-interface DNS setting are reset to their defaults, undoing all effects of dns,\ndomain, default-route, llmnr, mdns, dnssec, dnsovertls, nta. Note that when a network\ninterface disappears all configuration is lost automatically, an explicit reverting is\nnot necessary in that case.\n\nAdded in version 239.\n"
                },
                {
                    "name": "monitor",
                    "content": "Show a continuous stream of local client resolution queries and their responses. Whenever\na local query is completed the query's DNS resource lookup key and resource records are\nshown. Note that this displays queries issued locally only, and does not immediately\nrelate to DNS requests submitted to configured DNS servers or the LLMNR or MulticastDNS\nzones, as lookups may be answered from the local cache, or might result in multiple DNS\ntransactions (for example to validate DNSSEC information). If CNAME/CNAME redirection\nchains are followed, a separate query will be displayed for each element of the chain.\nUse --json= to enable JSON output.\n\nAdded in version 252.\n"
                },
                {
                    "name": "show-cache",
                    "content": "Show current cache content, per scope. Use --json= to enable JSON output.\n\nAdded in version 254.\n"
                },
                {
                    "name": "show-server-state",
                    "content": "Show detailed server state information, per DNS Server. Use --json= to enable JSON\noutput.\n\nAdded in version 255.\n\nlog-level [LEVEL]\nIf no argument is given, print the current log level of the manager. If an optional\nargument LEVEL is provided, then the command changes the current log level of the manager\nto LEVEL (accepts the same values as --log-level= described in systemd(1)).\n\nAdded in version 244.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-4 -6",
                    "content": "By default, when resolving a hostname, both IPv4 and IPv6 addresses are acquired. By\nspecifying -4 only IPv4 addresses are requested, by specifying -6 only IPv6 addresses are\nrequested.\n\nAdded in version 239.\n",
                    "flag": "-6"
                },
                {
                    "name": "-i _ --interface=_",
                    "content": "Specifies the network interface to execute the query on. This may either be specified as\nnumeric interface index or as network interface string (e.g.  \"en0\"). Note that this\noption has no effect if system-wide DNS configuration (as configured in /etc/resolv.conf\nor /etc/systemd/resolved.conf) in place of per-link configuration is used.\n\nAdded in version 239.\n",
                    "flag": "-i",
                    "long": "--interface",
                    "arg": "_"
                },
                {
                    "name": "-p _ --protocol=_",
                    "content": "Specifies the network protocol for the query. May be one of \"dns\" (i.e. classic unicast\nDNS), \"llmnr\" (\u001b[34mLink-Local Multicast Name Resolution[5]), \"llmnr-ipv4\", \"llmnr-ipv6\"\n(LLMNR via the indicated underlying IP protocols), \"mdns\" (\u001b[34mMulticast DNS[6]),\n\"mdns-ipv4\", \"mdns-ipv6\" (MDNS via the indicated underlying IP protocols). By default the\nlookup is done via all protocols suitable for the lookup. If used, limits the set of\nprotocols that may be used. Use this option multiple times to enable resolving via\nmultiple protocols at the same time. The setting \"llmnr\" is identical to specifying this\nswitch once with \"llmnr-ipv4\" and once via \"llmnr-ipv6\". Note that this option does not\nforce the service to resolve the operation with the specified protocol, as that might\nrequire a suitable network interface and configuration. The special value \"help\" may be\nused to list known values.\n\nAdded in version 239.\n",
                    "flag": "-p",
                    "long": "--protocol",
                    "arg": "_"
                },
                {
                    "name": "-t _ --type=_ -c _ --class=_",
                    "content": "When used in conjunction with the query command, specifies the DNS resource record type\n(e.g.  A, AAAA, MX, ...) and class (e.g.  IN, ANY, ...) to look up. If these options are\nused a DNS resource record set matching the specified class and type is requested. The\nclass defaults to IN if only a type is specified. The special value \"help\" may be used to\nlist known values.\n\nWithout these options resolvectl query provides high-level domain name to address and\naddress to domain name resolution. With these options it provides low-level DNS resource\nrecord resolution. The search domain logic is automatically turned off when these options\nare used, i.e. specified domain names need to be fully qualified domain names. Moreover,\nIDNA internal domain name translation is turned off as well, i.e. international domain\nnames should be specified in \"xn--...\"  notation, unless look-up in MulticastDNS/LLMNR is\ndesired, in which case UTF-8 characters should be used.\n\nAdded in version 239.\n\n--service-address=BOOL\nTakes a boolean parameter. If true (the default), when doing a service lookup with\n--service the hostnames contained in the SRV resource records are resolved as well.\n\nAdded in version 239.\n\n--service-txt=BOOL\nTakes a boolean parameter. If true (the default), when doing a DNS-SD service lookup with\n--service the TXT service metadata record is resolved as well.\n\nAdded in version 239.\n\n--cname=BOOL\nTakes a boolean parameter. If true (the default), DNS CNAME or DNAME redirections are\nfollowed. Otherwise, if a CNAME or DNAME record is encountered while resolving, an error\nis returned.\n\nAdded in version 239.\n\n--validate=BOOL\nTakes a boolean parameter; used in conjunction with query. If true (the default), DNSSEC\nvalidation is applied as usual — under the condition that it is enabled for the network\nand for systemd-resolved.service as a whole. If false, DNSSEC validation is disabled for\nthe specific query, regardless of whether it is enabled for the network or in the\nservice. Note that setting this option to true does not force DNSSEC validation on\nsystems/networks where DNSSEC is turned off. This option is only suitable to turn off\nsuch validation where otherwise enabled, not enable validation where otherwise disabled.\n\nAdded in version 248.\n\n--synthesize=BOOL\nTakes a boolean parameter; used in conjunction with query. If true (the default), select\ndomains are resolved on the local system, among them \"localhost\", \"gateway\",\n\"outbound\", \"localdnsstub\" and \"localdnsproxy\" or entries from /etc/hosts. If false\nthese domains are not resolved locally, and either fail (in case of \"localhost\",\n\"gateway\" or \"outbound\" and suchlike) or go to the network via regular DNS/mDNS/LLMNR\nlookups (in case of /etc/hosts entries).\n\nAdded in version 248.\n\n--cache=BOOL\nTakes a boolean parameter; used in conjunction with query. If true (the default), lookups\nuse the local DNS resource record cache. If false, lookups are routed to the network\ninstead, regardless if already available in the local cache.\n\nAdded in version 248.\n\n--zone=BOOL\nTakes a boolean parameter; used in conjunction with query. If true (the default), lookups\nare answered from locally registered LLMNR or mDNS resource records, if defined. If\nfalse, locally registered LLMNR/mDNS records are not considered for the lookup request.\n\nAdded in version 248.\n\n--trust-anchor=BOOL\nTakes a boolean parameter; used in conjunction with query. If true (the default), lookups\nfor DS and DNSKEY are answered from the local DNSSEC trust anchors if possible. If false,\nthe local trust store is not considered for the lookup request.\n\nAdded in version 248.\n\n--network=BOOL\nTakes a boolean parameter; used in conjunction with query. If true (the default), lookups\nare answered via DNS, LLMNR or mDNS network requests if they cannot be synthesized\nlocally, or be answered from the local cache, zone or trust anchors (see above). If\nfalse, the request is not answered from the network and will thus fail if none of the\nindicated sources can answer them.\n\nAdded in version 248.\n\n--search=BOOL\nTakes a boolean parameter. If true (the default), any specified single-label hostnames\nwill be searched in the domains configured in the search domain list, if it is non-empty.\nOtherwise, the search domain logic is disabled. Note that this option has no effect if\n--type= is used (see above), in which case the search domain logic is unconditionally\nturned off.\n\nAdded in version 239.\n\n--raw[=payload|packet]\nDump the answer as binary data. If there is no argument or if the argument is \"payload\",\nthe payload of the packet is exported. If the argument is \"packet\", the whole packet is\ndumped in wire format, prefixed by length specified as a little-endian 64-bit number.\nThis format allows multiple packets to be dumped and unambiguously parsed.\n\nAdded in version 239.\n\n--legend=BOOL\nTakes a boolean parameter. If true (the default), column headers and meta information\nabout the query response are shown. Otherwise, this output is suppressed.\n\nAdded in version 239.\n\n--stale-data=BOOL\nTakes a boolean parameter; used in conjunction with query. If true (the default), lookups\nare answered with stale data (expired resource records) if possible. If false, the stale\ndata is not considered for the lookup request.\n\nAdded in version 254.\n\n--json=MODE\nShows output formatted as JSON. Expects one of \"short\" (for the shortest possible output\nwithout any redundant whitespace or line breaks), \"pretty\" (for a pretty version of the\nsame, with indentation and line breaks) or \"off\" (to turn off JSON output, the default).\n",
                    "flag": "-c",
                    "long": "--class",
                    "arg": "_"
                },
                {
                    "name": "-j",
                    "content": "Short for --json=auto\n\nAdded in version 252.\n",
                    "flag": "-j"
                },
                {
                    "name": "--no-pager",
                    "content": "Do not pipe output into a pager.\n",
                    "long": "--no-pager"
                },
                {
                    "name": "-h --help",
                    "content": "Print a short help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "--version",
                    "content": "Print a short version string and exit.\n\nCOMPATIBILITY WITH RESOLVCONF(8)\nresolvectl is a multi-call binary. When invoked as \"resolvconf\" (generally achieved by means\nof a symbolic link of this name to the resolvectl binary) it is run in a limited\nresolvconf(8) compatibility mode. It accepts mostly the same arguments and pushes all data\ninto systemd-resolved.service(8), similar to how dns and domain commands operate. Note that\nsystemd-resolved.service is the only supported backend, which is different from other\nimplementations of this command.\n\n/etc/resolv.conf will only be updated with servers added with this command when\n/etc/resolv.conf is a symlink to /run/systemd/resolve/resolv.conf, and not a static file. See\nthe discussion of /etc/resolv.conf handling in systemd-resolved.service(8).\n\nNot all operations supported by other implementations are supported natively. Specifically:\n",
                    "long": "--version"
                },
                {
                    "name": "-a",
                    "content": "Registers per-interface DNS configuration data with systemd-resolved. Expects a network\ninterface name as only command line argument. Reads resolv.conf(5)-compatible DNS\nconfiguration data from its standard input. Relevant fields are \"nameserver\" and\n\"domain\"/\"search\". This command is mostly identical to invoking resolvectl with a\ncombination of dns and domain commands.\n\nAdded in version 239.\n",
                    "flag": "-a"
                },
                {
                    "name": "-d",
                    "content": "Unregisters per-interface DNS configuration data with systemd-resolved. This command is\nmostly identical to invoking resolvectl revert.\n\nAdded in version 239.\n",
                    "flag": "-d"
                },
                {
                    "name": "-f",
                    "content": "When specified -a and -d will not complain about missing network interfaces and will\nsilently execute no operation in that case.\n\nAdded in version 239.\n",
                    "flag": "-f"
                },
                {
                    "name": "-x",
                    "content": "This switch for \"exclusive\" operation is supported only partially. It is mapped to an\nadditional configured search domain of \"~.\"  — i.e. ensures that DNS traffic is\npreferably routed to the DNS servers on this interface, unless there are other, more\nspecific domains configured on other interfaces.\n\nAdded in version 239.\n",
                    "flag": "-x"
                },
                {
                    "name": "-m -p",
                    "content": "These switches are not supported and are silently ignored.\n\nAdded in version 239.\n",
                    "flag": "-p"
                },
                {
                    "name": "-u -I -i -l -R -r -v -V --enable-updates --disable-updates --are-updates-enabled",
                    "content": "These switches are not supported and the command will fail if used.\n\nAdded in version 239.\n\nSee resolvconf(8) for details on those command line options.\n",
                    "flag": "-V",
                    "long": "--are-updates-enabled"
                }
            ]
        },
        "EXAMPLES": {
            "content": "",
            "subsections": [
                {
                    "name": "Example 1. Retrieve the addresses of the \"www.0pointer.net\" domain (A and AAAA resource",
                    "content": ""
                },
                {
                    "name": "records)",
                    "content": "$ resolvectl query www.0pointer.net\nwww.0pointer.net: 2a01:238:43ed:c300:10c3:bcf3:3266:da74\n85.214.157.71\n\n-- Information acquired via protocol DNS in 611.6ms.\n-- Data is authenticated: no\n"
                },
                {
                    "name": "Example 2. Retrieve the domain of the \"85.214.157.71\" IP address (PTR resource record)",
                    "content": "$ resolvectl query 85.214.157.71\n85.214.157.71: gardel.0pointer.net\n\n-- Information acquired via protocol DNS in 1.2997s.\n-- Data is authenticated: no\n"
                },
                {
                    "name": "Example 3. Retrieve the MX record of the \"yahoo.com\" domain",
                    "content": "$ resolvectl --legend=no -t MX query yahoo.com\nyahoo.com. IN MX    1 mta7.am0.yahoodns.net\nyahoo.com. IN MX    1 mta6.am0.yahoodns.net\nyahoo.com. IN MX    1 mta5.am0.yahoodns.net\n"
                },
                {
                    "name": "Example 4. Resolve an SRV service",
                    "content": "$ resolvectl service xmpp-server.tcp gmail.com\nxmpp-server.tcp/gmail.com: alt1.xmpp-server.l.google.com:5269 [priority=20, weight=0]\n173.194.210.125\nalt4.xmpp-server.l.google.com:5269 [priority=20, weight=0]\n173.194.65.125\n...\n"
                },
                {
                    "name": "Example 5. Retrieve a PGP key (OPENPGP resource record)",
                    "content": "$ resolvectl openpgp zbyszek@fedoraproject.org\nd08ee310438ca124a6149ea5cc21b6313b390dce485576eff96f8722.openpgpkey.fedoraproject.org. IN OPENPGPKEY\nmQINBFBHPMsBEACeInGYJCb+7TurKfb6wGyTottCDtiSJB310i37/6ZYoeIay/5soJjlMyf\nMFQ9T2XNT/0LM6gTa0MpC1st9LnzYTMsT6tzRly1D1UbVI6xw0g0vE5y2Cjk3xUwAynCsSs\n...\n"
                },
                {
                    "name": "Example 6. Retrieve a TLS key (TLSA resource record)",
                    "content": "$ resolvectl tlsa tcp fedoraproject.org:443\n443.tcp.fedoraproject.org IN TLSA 0 0 1 19400be5b7a31fb733917700789d2f0a2471c0c9d506c0e504c06c16d7cb17c0\n-- Cert. usage: CA constraint\n-- Selector: Full Certificate\n-- Matching type: SHA-256\n\n\"tcp\" and \":443\" are optional and could be skipped.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "systemd(1), systemd-resolved.service(8), systemd.dnssd(5), systemd-networkd.service(8),\nresolvconf(8)\n",
            "subsections": []
        },
        "NOTES": {
            "content": "1. RFC 6763 DNS-SD\nhttps://tools.ietf.org/html/rfc6763\n\n2. RFC 2782 SRV\nhttps://tools.ietf.org/html/rfc2782\n\n3. RFC 7929\nhttps://tools.ietf.org/html/rfc7929\n\n4. RFC 6698\nhttps://tools.ietf.org/html/rfc6698\n\n5. Link-Local Multicast Name Resolution\nhttps://tools.ietf.org/html/rfc4795\n\n6. Multicast DNS\nhttps://www.ietf.org/rfc/rfc6762.txt\n\nsystemd 255                                                                            RESOLVECTL(1)",
            "subsections": []
        }
    },
    "summary": "resolvectl, resolvconf - Resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services; introspect and reconfigure the DNS resolver",
    "flags": [
        {
            "flag": "-6",
            "long": null,
            "arg": null,
            "description": "By default, when resolving a hostname, both IPv4 and IPv6 addresses are acquired. By specifying -4 only IPv4 addresses are requested, by specifying -6 only IPv6 addresses are requested. Added in version 239."
        },
        {
            "flag": "-i",
            "long": "--interface",
            "arg": "_",
            "description": "Specifies the network interface to execute the query on. This may either be specified as numeric interface index or as network interface string (e.g. \"en0\"). Note that this option has no effect if system-wide DNS configuration (as configured in /etc/resolv.conf or /etc/systemd/resolved.conf) in place of per-link configuration is used. Added in version 239."
        },
        {
            "flag": "-p",
            "long": "--protocol",
            "arg": "_",
            "description": "Specifies the network protocol for the query. May be one of \"dns\" (i.e. classic unicast DNS), \"llmnr\" (\u001b[34mLink-Local Multicast Name Resolution[5]), \"llmnr-ipv4\", \"llmnr-ipv6\" (LLMNR via the indicated underlying IP protocols), \"mdns\" (\u001b[34mMulticast DNS[6]), \"mdns-ipv4\", \"mdns-ipv6\" (MDNS via the indicated underlying IP protocols). By default the lookup is done via all protocols suitable for the lookup. If used, limits the set of protocols that may be used. Use this option multiple times to enable resolving via multiple protocols at the same time. The setting \"llmnr\" is identical to specifying this switch once with \"llmnr-ipv4\" and once via \"llmnr-ipv6\". Note that this option does not force the service to resolve the operation with the specified protocol, as that might require a suitable network interface and configuration. The special value \"help\" may be used to list known values. Added in version 239."
        },
        {
            "flag": "-c",
            "long": "--class",
            "arg": "_",
            "description": "When used in conjunction with the query command, specifies the DNS resource record type (e.g. A, AAAA, MX, ...) and class (e.g. IN, ANY, ...) to look up. If these options are used a DNS resource record set matching the specified class and type is requested. The class defaults to IN if only a type is specified. The special value \"help\" may be used to list known values. Without these options resolvectl query provides high-level domain name to address and address to domain name resolution. With these options it provides low-level DNS resource record resolution. The search domain logic is automatically turned off when these options are used, i.e. specified domain names need to be fully qualified domain names. Moreover, IDNA internal domain name translation is turned off as well, i.e. international domain names should be specified in \"xn--...\" notation, unless look-up in MulticastDNS/LLMNR is desired, in which case UTF-8 characters should be used. Added in version 239. --service-address=BOOL Takes a boolean parameter. If true (the default), when doing a service lookup with --service the hostnames contained in the SRV resource records are resolved as well. Added in version 239. --service-txt=BOOL Takes a boolean parameter. If true (the default), when doing a DNS-SD service lookup with --service the TXT service metadata record is resolved as well. Added in version 239. --cname=BOOL Takes a boolean parameter. If true (the default), DNS CNAME or DNAME redirections are followed. Otherwise, if a CNAME or DNAME record is encountered while resolving, an error is returned. Added in version 239. --validate=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), DNSSEC validation is applied as usual — under the condition that it is enabled for the network and for systemd-resolved.service as a whole. If false, DNSSEC validation is disabled for the specific query, regardless of whether it is enabled for the network or in the service. Note that setting this option to true does not force DNSSEC validation on systems/networks where DNSSEC is turned off. This option is only suitable to turn off such validation where otherwise enabled, not enable validation where otherwise disabled. Added in version 248. --synthesize=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), select domains are resolved on the local system, among them \"localhost\", \"gateway\", \"outbound\", \"localdnsstub\" and \"localdnsproxy\" or entries from /etc/hosts. If false these domains are not resolved locally, and either fail (in case of \"localhost\", \"gateway\" or \"outbound\" and suchlike) or go to the network via regular DNS/mDNS/LLMNR lookups (in case of /etc/hosts entries). Added in version 248. --cache=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups use the local DNS resource record cache. If false, lookups are routed to the network instead, regardless if already available in the local cache. Added in version 248. --zone=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups are answered from locally registered LLMNR or mDNS resource records, if defined. If false, locally registered LLMNR/mDNS records are not considered for the lookup request. Added in version 248. --trust-anchor=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups for DS and DNSKEY are answered from the local DNSSEC trust anchors if possible. If false, the local trust store is not considered for the lookup request. Added in version 248. --network=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups are answered via DNS, LLMNR or mDNS network requests if they cannot be synthesized locally, or be answered from the local cache, zone or trust anchors (see above). If false, the request is not answered from the network and will thus fail if none of the indicated sources can answer them. Added in version 248. --search=BOOL Takes a boolean parameter. If true (the default), any specified single-label hostnames will be searched in the domains configured in the search domain list, if it is non-empty. Otherwise, the search domain logic is disabled. Note that this option has no effect if --type= is used (see above), in which case the search domain logic is unconditionally turned off. Added in version 239. --raw[=payload|packet] Dump the answer as binary data. If there is no argument or if the argument is \"payload\", the payload of the packet is exported. If the argument is \"packet\", the whole packet is dumped in wire format, prefixed by length specified as a little-endian 64-bit number. This format allows multiple packets to be dumped and unambiguously parsed. Added in version 239. --legend=BOOL Takes a boolean parameter. If true (the default), column headers and meta information about the query response are shown. Otherwise, this output is suppressed. Added in version 239. --stale-data=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups are answered with stale data (expired resource records) if possible. If false, the stale data is not considered for the lookup request. Added in version 254. --json=MODE Shows output formatted as JSON. Expects one of \"short\" (for the shortest possible output without any redundant whitespace or line breaks), \"pretty\" (for a pretty version of the same, with indentation and line breaks) or \"off\" (to turn off JSON output, the default)."
        },
        {
            "flag": "-j",
            "long": null,
            "arg": null,
            "description": "Short for --json=auto Added in version 252."
        },
        {
            "flag": "",
            "long": "--no-pager",
            "arg": null,
            "description": "Do not pipe output into a pager."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Print a short help text and exit."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Print a short version string and exit. COMPATIBILITY WITH RESOLVCONF(8) resolvectl is a multi-call binary. When invoked as \"resolvconf\" (generally achieved by means of a symbolic link of this name to the resolvectl binary) it is run in a limited resolvconf(8) compatibility mode. It accepts mostly the same arguments and pushes all data into systemd-resolved.service(8), similar to how dns and domain commands operate. Note that systemd-resolved.service is the only supported backend, which is different from other implementations of this command. /etc/resolv.conf will only be updated with servers added with this command when /etc/resolv.conf is a symlink to /run/systemd/resolve/resolv.conf, and not a static file. See the discussion of /etc/resolv.conf handling in systemd-resolved.service(8). Not all operations supported by other implementations are supported natively. Specifically:"
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "Registers per-interface DNS configuration data with systemd-resolved. Expects a network interface name as only command line argument. Reads resolv.conf(5)-compatible DNS configuration data from its standard input. Relevant fields are \"nameserver\" and \"domain\"/\"search\". This command is mostly identical to invoking resolvectl with a combination of dns and domain commands. Added in version 239."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Unregisters per-interface DNS configuration data with systemd-resolved. This command is mostly identical to invoking resolvectl revert. Added in version 239."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "When specified -a and -d will not complain about missing network interfaces and will silently execute no operation in that case. Added in version 239."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "This switch for \"exclusive\" operation is supported only partially. It is mapped to an additional configured search domain of \"~.\" — i.e. ensures that DNS traffic is preferably routed to the DNS servers on this interface, unless there are other, more specific domains configured on other interfaces. Added in version 239."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "These switches are not supported and are silently ignored. Added in version 239."
        },
        {
            "flag": "-V",
            "long": "--are-updates-enabled",
            "arg": null,
            "description": "These switches are not supported and the command will fail if used. Added in version 239. See resolvconf(8) for details on those command line options."
        }
    ],
    "examples": [
        "$ resolvectl query www.0pointer.net",
        "www.0pointer.net: 2a01:238:43ed:c300:10c3:bcf3:3266:da74",
        "85.214.157.71",
        "-- Information acquired via protocol DNS in 611.6ms.",
        "-- Data is authenticated: no",
        "$ resolvectl query 85.214.157.71",
        "85.214.157.71: gardel.0pointer.net",
        "-- Information acquired via protocol DNS in 1.2997s.",
        "-- Data is authenticated: no",
        "$ resolvectl --legend=no -t MX query yahoo.com",
        "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",
        "$ resolvectl service xmpp-server.tcp gmail.com",
        "xmpp-server.tcp/gmail.com: alt1.xmpp-server.l.google.com:5269 [priority=20, weight=0]",
        "173.194.210.125",
        "alt4.xmpp-server.l.google.com:5269 [priority=20, weight=0]",
        "173.194.65.125",
        "...",
        "$ resolvectl openpgp zbyszek@fedoraproject.org",
        "d08ee310438ca124a6149ea5cc21b6313b390dce485576eff96f8722.openpgpkey.fedoraproject.org. IN OPENPGPKEY",
        "mQINBFBHPMsBEACeInGYJCb+7TurKfb6wGyTottCDtiSJB310i37/6ZYoeIay/5soJjlMyf",
        "MFQ9T2XNT/0LM6gTa0MpC1st9LnzYTMsT6tzRly1D1UbVI6xw0g0vE5y2Cjk3xUwAynCsSs",
        "...",
        "$ resolvectl 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",
        "\"tcp\" and \":443\" are optional and could be skipped."
    ],
    "see_also": [
        {
            "name": "systemd",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
        },
        {
            "name": "systemd-resolved.service",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/systemd-resolved.service/8/json"
        },
        {
            "name": "systemd.dnssd",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.dnssd/5/json"
        },
        {
            "name": "systemd-networkd.service",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/systemd-networkd.service/8/json"
        },
        {
            "name": "resolvconf",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/resolvconf/8/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Resolve domain names, IPv4 and IPv6 addresses, DNS resource records, and services.",
        "examples": [
            {
                "description": "Show DNS settings",
                "command": "resolvectl"
            },
            {
                "description": "Resolve the IPv4 and IPv6 addresses for one or more domains",
                "command": "resolvectl query {{domain1 domain2 ...}}"
            },
            {
                "description": "Retrieve the domain of a specified IP address",
                "command": "resolvectl query {{ip_address}}"
            },
            {
                "description": "Flush all local DNS caches",
                "command": "resolvectl flush-caches"
            },
            {
                "description": "Display DNS statistics (transactions, cache, and DNSSEC verdicts)",
                "command": "resolvectl statistics"
            },
            {
                "description": "Retrieve an MX record of a domain",
                "command": "resolvectl --legend {{no}} {{-t|--type}} MX query {{domain}}"
            },
            {
                "description": "Resolve an SRV record, for example `_xmpp-server._tcp gmail.com`",
                "command": "resolvectl service _{{service}}._{{protocol}} {{name}}"
            },
            {
                "description": "Retrieve a TLS key",
                "command": "resolvectl tlsa tcp {{domain}}:443"
            }
        ]
    }
}