You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+92-24Lines changed: 92 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,69 @@ This greatly simplifies keeping DNS zones current when keys change as no zone fi
12
12
Requires Python3.4+ and the py3dns package.
13
13
py3dns can be installed via:
14
14
15
-
pip install py3dns
16
-
17
-
or if you have both Python2 and Python3 installed:
18
-
19
-
pip3 install py3dns
15
+
sudo pip3 install -r requirements.txt
20
16
21
17
Clone this repository or download the `bindtool` file and install it on your master DNS server.
22
18
Optionally copy the `bindtool.example.json` file to `bindtool.json` in the installed directory and edit the configuration options.
23
19
24
20
21
+
### Configuration
22
+
23
+
The example configuration file lists all possible options and their defaults.
24
+
Only values that are different from the defaults need to be present.
25
+
26
+
The configuration file `bindtool.json` may be placed in the current working directory,
27
+
in /etc/bindtool,
28
+
or in the same directory as the bindtool tool is installed in.
29
+
A different configuration file name may be specified on the command line.
30
+
If the specified file name is not an absolute path,
31
+
it will be searched for in the same locations,
32
+
e.g. `bindtool --config config.json` will load `./config.json`, `/etc/bindtool/config.json`, or `<install-dir>/config.json`.
33
+
The file must adhere to standard JSON format.
34
+
35
+
#### Defaults
36
+
37
+
The `defaults` section specifies the default values for all of the arguments for the various record commands.
38
+
39
+
For example, to change the default `expire` value for SOA records::
40
+
41
+
"defaults": {
42
+
"soa": {
43
+
"expire": "7d",
44
+
}
45
+
},
46
+
...
47
+
48
+
49
+
#### Directories
50
+
51
+
The `directories` section specifies the directories to find various file types in.
52
+
53
+
Directory values may include Python format strings for variable substitution.
54
+
All directory types accept the {name} field.
55
+
Certificate and private key directories also accept the {key_type}, {suffix}, and {username} fields.
56
+
The dkim directory accepts the {selector} and {domain} fields.
57
+
58
+
59
+
#### Key Type Suffixes
60
+
61
+
Each certificate and key file will have a suffix, just before the file extension,
62
+
indicating the type of key the file is for.
63
+
64
+
The default suffix used for each key type can be overridden in the `key_type_suffixes` section.
65
+
If you are only using a single key type, or want to omit the suffix from one key type,
66
+
set it to an empty string.
67
+
Note that if using multiple key types the suffix must be unique or files will be overridden.
68
+
69
+
70
+
#### File Names
71
+
72
+
All output file names can be overridden using standard Python format strings.
73
+
All file name types accept the {name} field.
74
+
Certificate and private key file names also accept the {key_type}, {suffix}, and {username} fields.
75
+
The dkim file name accepts the {selector} and {domain} fields.
76
+
77
+
25
78
## Usage
26
79
27
80
Run the command:
@@ -71,7 +124,7 @@ Additional source files can be included via the following syntax:
71
124
{{include:file_path}}
72
125
73
126
The file found at `file_path` will be included in the output as though the contents of that file were included inline.
74
-
The file path is relative to the path of the file containing the `include` command.
127
+
The file path is relative to the path of the file containing the `include` command or the configured `include` directory.
75
128
Include files can include additional files.
76
129
Variables defined in an include file are available for use in the file containing the `include` command at any point after the `include`.
77
130
@@ -133,21 +186,26 @@ Becomes:
133
186
134
187
SSHFP records are specified as follows:
135
188
136
-
{{sshfp:hostname:key_file:ttl}}
189
+
{{sshfp:hostname:key_file:ttl:type}}
137
190
138
191
All arguments are optional.
139
192
140
193
*`hostname` is the host name for the SSHFP record.
141
194
The default value is `@`.
142
195
*`key_file` is the name of the file the SSH host key files.
143
-
The default value is `ssh_host`, note that key file names do not include the key type or file extension.
144
-
If an absolute path is not specified, the path will be relative to `/etc/ssh` (may be changed in the config file).
196
+
Key file names may be absolute or relative paths.
197
+
If the file name is an absolute path, it will be used verbatim,
198
+
otherwise the file path will be relative to the configured `ssh` directory (`/etc/ssh` by default)
199
+
and the file name will be passed into the `ssh` file name format string, adding the key type and extension.
200
+
The default value is `ssh_host`.
201
+
If using an absolute path, the `type` must also be specified.
145
202
*`ttl` is the TTL value for the SSHFP record.
146
203
The default value is empty.
204
+
*`type` is blank or one of the following: `rsa`, `dsa`, `ecdsa`, `ed25519`.
205
+
If `type` is blank, SSHFP records will be generated for all key types for which public key files can be found,
206
+
otherwise records for only the specified key type will be generated.
147
207
148
-
The following key types are recognized: `rsa`, `dsa`, `ecdsa`, and `ed25519`.
149
208
Two SSHFP records will be generated for each key file that is present, one with a SHA1 digest and one with a SHA256 digest.
150
-
Note that the expected key files must be named: `<key_file>_<key_type>_key.pub`, e.g.: `ssh_host_ecdsa_key.pub`
151
209
152
210
Example:
153
211
@@ -173,9 +231,11 @@ The `port` argument is required, all others are optional.
173
231
*`host` is the host name for the service.
174
232
The default value is `@`.
175
233
*`cert_file` is the file name of the certificate or private key used to secure the service.
234
+
If the file name is an absolute path, it will be used verbatim,
235
+
otherwise the file path will be relative to the configured `certificate`, `private_key`, `backup_key`, or `previous_key` directory
236
+
and the file name will be passed into the correspoding file name format string.
237
+
Private keys will be searched for in each of the key directories.
176
238
The default value is the name of the source zone file.
177
-
For certificate files the `.pem` file extension is optional, for private key files the `.key` file extension is optional.
178
-
If an absolute path is not specified, the path for certificate files will be relative to `/etc/ssl/certs` and the path for private key files will be realtive to `/etc/ssl/private` (may be changed in the config file).
179
239
*`usage` is one of the following: `pkix-ta`, `pkix-ee`, `dane-ta`, or `dane-ee`.
180
240
The default value is `pkix-ee`.
181
241
*`selector` is `cert`, or `spki`.
@@ -195,8 +255,8 @@ The default value is empty.
195
255
196
256
Two TLSA records will be generated for each available key type,
197
257
one using a SHA256 digest and one using a SHA512 digest.
198
-
When using the `spki` selector, the tool will additionally look for a backup key file using the file name of the `cert_file` + `_backup` (before the file extension, e.g. `example.com_backup.key`).
199
-
If a backup key is found, additional TLSA records will be generated for the backup key.
258
+
When using the `spki` selector, the tool will additionally look for backup and previous key files.
259
+
If a backup or previous key is found, additional TLSA records will be generated for those keys.
200
260
201
261
Example:
202
262
@@ -220,10 +280,12 @@ The `user` argument is required, all others are optional.
220
280
*`host` is the host name for the email address.
221
281
The default value is `@`.
222
282
*`cert_file` is the file name of the certificate or private key used for S/MIME email for the user.
283
+
If the file name is an absolute path, it will be used verbatim,
284
+
otherwise the file path will be relative to the configured `certificate`, `private_key`, `backup_key`, or `previous_key` directory
285
+
and the file name will be passed into the correspoding file name format string.
286
+
Private keys will be searched for in each of the key directories.
223
287
The default value is the name of the source zone file.
224
-
The tool will first search for a certificate or private key file with the `user` argument + `@` prepended to the file name, e.g. {{smimea:user}} will search for `user@example.com`, then `example.com`.
225
-
For certificate files the `.pem` file extension is optional, for private key files the `.key` file extension is optional.
226
-
If an absolute path is not specified, the path for certificate files will be relative to `/etc/ssl/certs` and the path for private key files will be realtive to `/etc/ssl/private` (may be changed in the config file).
288
+
By default the `user` argument + `@` will be prepended to the file name, e.g. {{smimea:user}} will search for `user@example.com.rsa.pem`, etc.
227
289
*`usage` is one of the following: `pkix-ta`, `pkix-ee`, `dane-ta`, or `dane-ee`.
228
290
The default value is `pkix-ee`.
229
291
*`selector` is `cert`, or `spki`.
@@ -242,8 +304,8 @@ The default value is empty.
242
304
Two SMIMEA records will be generated for each available key type,
243
305
one using a SHA256 digest and one using a SHA512 digest.
244
306
For `cert` selectors an additional record will be generated with the full contents of the certificate.
245
-
When using the `spki` selector, the tool will additionally look for a backup key file using the file name of the `cert_file` + `_backup` (before the file extension, e.g. `example.com_backup.key`).
246
-
If a backup key is found, additional SMIMEA records will be generated for the backup key.
307
+
When using the `spki` selector, the tool will additionally look for backup and previous key files.
308
+
If a backup or previous key is found, additional SMIMEA records will be generated for those keys.
247
309
248
310
Example:
249
311
@@ -264,8 +326,10 @@ ACME Challenge (TXT) records are specified as follows:
264
326
All arguments are optional.
265
327
266
328
*`challenge_file` is the file name of the json file storing ACME challenge information.
329
+
If the file name is an absolute path, it will be used verbatim,
330
+
otherwise the file path will be relative to the configured `acme` directory
331
+
and the file name will be passed into the correspoding file name format string.
267
332
The default value is the name of the source zone file.
268
-
If an absolute path is not specified, the path will be relative to `/etc/ssl/challenges` (may be changed in the config file).
269
333
*`ttl` is the TTL value for the TXT record.
270
334
The default value is empty.
271
335
@@ -288,12 +352,17 @@ Becomes:
288
352
289
353
DKIM (TXT) records are specified as follows:
290
354
291
-
{{dkim:domain:host:ttl}}
355
+
{{dkim:selector:domain:host:ttl}}
292
356
293
357
All arguments are optional.
294
358
359
+
*`selector` is the DKIM selector.
360
+
The default value is specified in the `settings` section of the config file.
295
361
*`domain` is the name of the OpenDKIM private key.
296
-
If an absolute path is not specified, the key will be in a path relative to `/etc/opendkim/keys` (may be changed in the config file) and in a file named `default.private`, e.g. `/etc/opendkim/<domain>/default.private`.
362
+
If `domain` is an absolute path, it will be used verbatim,
363
+
otherwise the file path will be relative to the configured `dkim` directory
364
+
and the file name will be passed into the correspoding file name format string.
365
+
The default value is the name of the source zone file.
0 commit comments