1- ===================
2- DNS Resolver Module
3- ===================
1+ .. SPDX-License-Identifier: GPL-2.0
42
5- Contents:
3+ ===================
4+ DNS Resolver Module
5+ ===================
6+
7+ .. Contents:
68
79 - Overview.
810 - Compilation.
@@ -12,8 +14,7 @@ Contents:
1214 - Debugging.
1315
1416
15- ========
16- OVERVIEW
17+ Overview
1718========
1819
1920The DNS resolver module provides a way for kernel services to make DNS queries
@@ -33,50 +34,50 @@ It does not yet support the following AFS features:
3334This code is extracted from the CIFS filesystem.
3435
3536
36- ===========
37- COMPILATION
37+ Compilation
3838===========
3939
40- The module should be enabled by turning on the kernel configuration options:
40+ The module should be enabled by turning on the kernel configuration options::
4141
4242 CONFIG_DNS_RESOLVER - tristate "DNS Resolver support"
4343
4444
45- ==========
46- SETTING UP
45+ Setting up
4746==========
4847
4948To set up this facility, the /etc/request-key.conf file must be altered so that
5049/sbin/request-key can appropriately direct the upcalls. For example, to handle
5150basic dname to IPv4/IPv6 address resolution, the following line should be
52- added:
51+ added::
52+
5353
5454 #OP TYPE DESC CO-INFO PROGRAM ARG1 ARG2 ARG3 ...
5555 #====== ============ ======= ======= ==========================
5656 create dns_resolver * * /usr/sbin/cifs.upcall %k
5757
5858To direct a query for query type 'foo', a line of the following should be added
59- before the more general line given above as the first match is the one taken.
59+ before the more general line given above as the first match is the one taken::
6060
6161 create dns_resolver foo:* * /usr/sbin/dns.foo %k
6262
6363
64- =====
65- USAGE
64+ Usage
6665=====
6766
6867To make use of this facility, one of the following functions that are
69- implemented in the module can be called after doing:
68+ implemented in the module can be called after doing::
7069
7170 #include <linux/dns_resolver.h>
7271
73- (1) int dns_query(const char *type, const char *name, size_t namelen,
74- const char *options, char **_result, time_t *_expiry);
72+ ::
73+
74+ int dns_query(const char *type, const char *name, size_t namelen,
75+ const char *options, char **_result, time_t *_expiry);
7576
7677 This is the basic access function. It looks for a cached DNS query and if
7778 it doesn't find it, it upcalls to userspace to make a new DNS query, which
7879 may then be cached. The key description is constructed as a string of the
79- form:
80+ form::
8081
8182 [<type>:]<name>
8283
@@ -107,16 +108,14 @@ This can be cleared by any process that has the CAP_SYS_ADMIN capability by
107108the use of KEYCTL_KEYRING_CLEAR on the keyring ID.
108109
109110
110- ===============================
111- READING DNS KEYS FROM USERSPACE
111+ Reading DNS Keys from Userspace
112112===============================
113113
114114Keys of dns_resolver type can be read from userspace using keyctl_read() or
115115"keyctl read/print/pipe".
116116
117117
118- =========
119- MECHANISM
118+ Mechanism
120119=========
121120
122121The dnsresolver module registers a key type called "dns_resolver". Keys of
@@ -147,11 +146,10 @@ See <file:Documentation/security/keys/request-key.rst> for further
147146information about request-key function.
148147
149148
150- =========
151- DEBUGGING
149+ Debugging
152150=========
153151
154152Debugging messages can be turned on dynamically by writing a 1 into the
155- following file:
153+ following file::
156154
157- /sys/module/dnsresolver/parameters/debug
155+ /sys/module/dnsresolver/parameters/debug
0 commit comments