From: Zbigniew Jędrzejewski-Szmek Date: Wed, 21 Oct 2020 11:53:59 +0000 (+0200) Subject: man/org.freedesktop.resolve1: briefly document a bunch of methods and properties X-Git-Tag: v247-rc1~22^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ce493672cb9a42ff0960ed127a850a8abfd12d1;p=thirdparty%2Fsystemd.git man/org.freedesktop.resolve1: briefly document a bunch of methods and properties Fixes #13799. --- diff --git a/man/org.freedesktop.resolve1.xml b/man/org.freedesktop.resolve1.xml index 6a6d9de6b98..b06155662a5 100644 --- a/man/org.freedesktop.resolve1.xml +++ b/man/org.freedesktop.resolve1.xml @@ -156,12 +156,6 @@ node /org/freedesktop/resolve1 { }; - - - - - - @@ -170,28 +164,8 @@ node /org/freedesktop/resolve1 { - - - - - - - - - - - - - - - - - - - - @@ -281,26 +255,28 @@ node /org/freedesktop/resolve1 { Methods - ResolveHostname() takes a hostname and resolves it to one or more IP addresses. - As parameters it takes the Linux network interface index to execute the query on, or 0 if it may be - done on any suitable interface. The name parameter specifies the hostname to - resolve. Note that if required, IDNA conversion is applied to this name unless it is resolved via LLMNR or MulticastDNS. The family parameter - limits the results to a specific address family. It may be AF_INET, - AF_INET6 or AF_UNSPEC. If AF_UNSPEC is specified (recommended), both kinds are retrieved, subject - to local network configuration (i.e. if no local, routable IPv6 address is found, no IPv6 address is - retrieved; and similarly for IPv4). A 64-bit flags field may be used to alter the - behaviour of the resolver operation (see below). The method returns an array of address records. Each - address record consists of the interface index the address belongs to, an address family as well as a - byte array with the actual IP address data (which either has 4 or 16 elements, depending on the address - family). The returned address family will be one of AF_INET or - AF_INET6. For IPv6, the returned address interface index should be used to - initialize the .sin6_scope_id field of a struct sockaddr_in6 instance to permit - support for resolution to link-local IP addresses. The address array is followed by the canonical name - of the host, which may or may not be identical to the resolved hostname. Finally, a 64-bit - flags field is returned that is defined similarly to the flags - field that was passed in, but contains information about the resolved data (see below). If the hostname - passed in is an IPv4 or IPv6 address formatted as string, it is parsed, and the result is returned. In - this case, no network communication is done. + ResolveHostname() takes a hostname and resolves it to one or more IP + addresses. As parameters it takes the Linux network interface index to execute the query on, or 0 if + it may be done on any suitable interface. The name parameter specifies the hostname + to resolve. Note that if required, IDNA conversion is applied to this name unless it is resolved via + LLMNR or MulticastDNS. The family parameter limits the results to a specific address + family. It may be AF_INET, AF_INET6 or + AF_UNSPEC. If AF_UNSPEC is specified (recommended), both + kinds are retrieved, subject to local network configuration (i.e. if no local, routable IPv6 address is + found, no IPv6 address is retrieved; and similarly for IPv4). A 64-bit flags field + may be used to alter the behaviour of the resolver operation (see below). The method returns an array + of address records. Each address record consists of the interface index the address belongs to, an + address family as well as a byte array with the actual IP address data (which either has 4 or 16 + elements, depending on the address family). The returned address family will be one of + AF_INET or AF_INET6. For IPv6, the returned address interface + index should be used to initialize the .sin6_scope_id field of a + struct sockaddr_in6 instance to permit support for resolution to link-local IP + addresses. The address array is followed by the canonical name of the host, which may or may not be + identical to the resolved hostname. Finally, a 64-bit flags field is returned that + is defined similarly to the flags field that was passed in, but contains information + about the resolved data (see below). If the hostname passed in is an IPv4 or IPv6 address formatted as + string, it is parsed, and the result is returned. In this case, no network communication is + done. ResolveAddress() executes the reverse operation: it takes an IP address and acquires one or more hostnames for it. As parameters it takes the interface index to execute the query @@ -387,15 +363,19 @@ node /org/freedesktop/resolve1 { AF_INET6), followed by a 4-byte or 16-byte array with the raw address data. This method is a one-step shortcut for retrieving the Link object for a network interface using GetLink() (see above) and then invoking the SetDNS() method - (see below) on it. + (see below) on it. + + SetLinkDNSEx() is similar to SetLinkDNS(), but allows + an IP port (instead of the default 53) and DNS name to be specified for each DNS server. The server + name is used for Server Name Indication (SNI), which is useful when DNS-over-TLS is + used. C.f. DNS= in + resolved.conf5. - Network management software integrating with systemd-resolved should - call this method (and the five below) after the interface appeared in the kernel (and thus after a - network interface index has been assigned), but before the network interfaces is activated - (IFF_UP set) so that all settings take effect during the full time the network - interface is up. It is safe to alter settings while the interface is up, however. Use - RevertLink() (described below) to reset all per-interface settings. + SetLinkDefaultRoute() specifies whether the link shall be used as the + default route for name queries. See the description of name routing in + systemd-resolved.service8 + for details. The SetLinkDomains() method sets the search and routing domains to use on a specific network interface for DNS look-ups. It takes a network interface index and an array of domains, @@ -432,8 +412,22 @@ node /org/freedesktop/resolve1 { Negative Trust Anchors (NTAs) for a specific network interface. It takes a network interface index and a list of domains as arguments. - The RevertLink() method may be used to revert all per-link settings done with - the six methods described above to the defaults again. + The SetLinkDNSOverTLS() method enables or disables DNS-over-TLS. + C.f. DNSOverTLS= in + systemd-resolved.service8 + for details. + + Network management software integrating with systemd-resolved should call + SetLinkDNS() or SetLinkDNSEx(), + SetLinkDefaultRoute(), SetLinkDomains() and others after the + interface appeared in the kernel (and thus after a network interface index has been assigned), but + before the network interfaces is activated (IFF_UP set) so that all settings take + effect during the full time the network interface is up. It is safe to alter settings while the + interface is up, however. Use RevertLink() (described below) to reset all + per-interface settings. + + The RevertLink() method may be used to revert all per-link settings + described above to the defaults. The Flags Parameter @@ -458,11 +452,11 @@ node /org/freedesktop/resolve1 { classic unicast DNS, LLMNR via IPv4/UDP and IPv6/UDP respectively, as well as MulticastDNS via IPv4/UDP and IPv6/UDP. If all of these five bits are off on input (which is strongly recommended) the look-up will be done via all suitable protocols for the specific look-up. Note that these flags - operate as filter only, but cannot force a look-up to be done via a protocol. Specifically, systemd-resolved - will only route look-ups within the .local TLD to MulticastDNS (plus some reverse look-up address - domains), and single-label names to LLMNR (plus some reverse address lookup domains). It will route - neither of these to Unicast DNS servers. Also, it will do LLMNR and Multicast DNS only on interfaces - suitable for multicast. + operate as filter only, but cannot force a look-up to be done via a protocol. Specifically, + systemd-resolved will only route look-ups within the .local TLD to MulticastDNS + (plus some reverse look-up address domains), and single-label names to LLMNR (plus some reverse + address lookup domains). It will route neither of these to Unicast DNS servers. Also, it will do + LLMNR and Multicast DNS only on interfaces suitable for multicast. On output, these five flags indicate which protocol was used to execute the operation, and hence where the data was found. @@ -498,34 +492,50 @@ node /org/freedesktop/resolve1 { the data is "rightfully" unauthenticated (which includes cases where the underlying protocol or server does not support authenticating data). - - + Properties + The LLMNR and MulticastDNS properties report whether LLMNR + and MulticastDNS are (globally) enabled. Each may be one of yes, + no, and resolve. See SetLinkLLMNR() + and SetLinkMulticastDNS() above. + LLMNRHostname contains the hostname currently exposed on the network via LLMNR. It usually follows the system hostname as may be queried via gethostname3, but may differ if a conflict is detected on the network. - DNS contains an array of all DNS servers currently used by - systemd-resolved. It contains similar information as the DNS server data written to - /run/systemd/resolve/resolv.conf. Each structure in the array consists of a numeric network interface - index, an address family, and a byte array containing the DNS server address (either 4 bytes in length - for IPv4 or 16 bytes in lengths for IPv6). The array contains DNS servers configured system-wide, - including those possibly read from a foreign /etc/resolv.conf or the - DNS= setting in /etc/systemd/resolved.conf, as well as - per-interface DNS server information either retrieved from + DNS and DNSEx contain arrays of all DNS servers currently + used by systemd-resolved. DNS contains information similar to + the DNS server data in /run/systemd/resolve/resolv.conf. Each structure in the + array consists of a numeric network interface index, an address family, and a byte array containing the + DNS server address (either 4 bytes in length for IPv4 or 16 bytes in lengths for IPv6). + DNSEx is similar, but additionally contains the IP port and server name (used for + Server Name Indication, SNI). Both arrays contain DNS servers configured system-wide, including those + possibly read from a foreign /etc/resolv.conf or the DNS= + setting in /etc/systemd/resolved.conf, as well as per-interface DNS server + information either retrieved from systemd-networkd8, - or configured by external software via SetLinkDNS() (see above). The network - interface index will be 0 for the system-wide configured services and non-zero for the per-link - servers. + or configured by external software via SetLinkDNS() or + SetLinkDNSEx() (see above). The network interface index will be 0 for the + system-wide configured services and non-zero for the per-link servers. + + FallbackDNS and FallbackDNSEx contain arrays of all DNS + servers configured as fallback servers, if any, using the same format as DNS and + DNSEx described above. See the description of FallbackDNS= in + resolved.conf5 for + the description of when those servers are used. - Similarly, the Domains property contains an array of all search and - routing domains currently used by systemd-resolved. Each entry consists of a network interface index (again, 0 - encodes system-wide entries), the actual domain name, and whether the entry is used only for routing - (true) or for both routing and searching (false). + CurrentDNSServer and CurrentDNSServerEx specify the server + that is currently used for query resolution, in the same format as a single entry in the + DNS and DNSEx arrays described above. + + Similarly, the Domains property contains an array of all search and routing + domains currently used by systemd-resolved. Each entry consists of a network + interface index (again, 0 encodes system-wide entries), the actual domain name, and whether the entry + is used only for routing (true) or for both routing and searching (false). The TransactionStatistics property contains information about the number of transactions systemd-resolved has processed. It contains a pair of unsigned 64-bit counters, the first @@ -540,7 +550,14 @@ node /org/freedesktop/resolve1 { operations so far. It exposes three 64-bit counters: the first being the total number of current cache entries (both positive and negative), the second the number of cache hits, and the third the number of cache misses. The latter counters may be reset using ResetStatistics() (see - above). + above). + + The DNSSEC property specifies current status of DNSSEC validation. It is one + of yes (validation is enforced), no (no validation is done), + allow-downgrade (validation is done if the current DNS server supports it). See the + description of DNSSEC= in + resolved.conf5. + The DNSSECStatistics property contains information about the DNSSEC validations executed so far. It contains four 64-bit counters: the number of secure, insecure, bogus, @@ -559,12 +576,20 @@ node /org/freedesktop/resolve1 { DNSSEC is supported by DNS servers until it verifies that this is not the case. Thus, the reported value may initially be true, until the first transactions are executed. + The DNSOverTLS boolean property reports whether DNS-over-TLS is enabled. + + The ResolvConfMode property exposes how /etc/resolv.conf is managed on the host. Currently, the values uplink, stub, static (these three correspond to the three different files systemd-resolved.service provides), foreign (the file is managed by admin or another service, systemd-resolved.service just consumes it), missing (/etc/resolv.conf is missing). + + The DNSStubListener property reports whether the stub listener on port 53 is + enabled. Possible values are yes (enabled), no (disabled), + udp (only the UDP listener is enabled), and tcp (only the TCP + listener is enabled). @@ -619,40 +644,6 @@ node /org/freedesktop/resolve1/link/_1 { }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -721,8 +712,13 @@ node /org/freedesktop/resolve1/link/_1 { SetLinkDNS() on the Manager object, the main difference being that the later expects an interface index to be specified. Invoking the methods on the Manager interface has the benefit of reducing roundtrips, as it is not necessary to first request the Link object path via - GetLink() before invoking the methods. For further details on these methods see - the Manager documentation above. + GetLink() before invoking the methods. The same relationship holds for + SetDNSEx(), SetDomains(), + SetDefaultRoute(), SetLLMNR(), + SetMulticastDNS(), SetDNSOverTLS(), + SetDNSSEC(), SetDNSSECNegativeTrustAnchors(), and + Revert(). For further details on these methods see the + Manager documentation above. @@ -744,8 +740,12 @@ node /org/freedesktop/resolve1/link/_1 { assumed available until it is detected that the configured server does not actually support it. Thus, this property may initially report that DNSSEC is supported on an interface. + DefaultRoute exposes a boolean field that indicates whether the interface will + be used as default route for name queries. See SetLinkDefaultRoute() above. + The other properties reflect the state of the various configuration settings for the link which - may be set with the various methods calls such as SetDNS() or SetLLMNR(). + may be set with the various methods calls such as SetDNS() or + SetLLMNR().