-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnsadm.1
179 lines (155 loc) · 5.02 KB
/
dnsadm.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
'\" te
.\" Copyright 2021, Brian Bennett.
.\" Licensed under the Apache License, Version 2.0 (the "License");
.\" you may not use this file except in compliance with the License.
.\" You may obtain a copy of the License at
.\"
.\" http://www.apache.org/licenses/LICENSE-2.0
.\"
.\" Unless required by applicable law or agreed to in writing, software
.\" distributed under the License is distributed on an "AS IS" BASIS,
.\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.\" See the License for the specific language governing permissions and
.\" limitations under the License.
.\"
.TH dnsadm 1 "20 Sep 2021" "dnsadm" "DNS Zone Administration"
.SH NAME
dnsadm \- Simple Dynamic DNS update utility
.SH SYNOPSIS
.LP
.nf
\fBdnsadm add\fR \fItype\fR \fIname\fR \fIvalue\fR
\fBdnsadm del\fR \fItype\fR \fIname\fR \fIvalue\fR
\fBdnsadm update\fR \fItype\fR \fIname\fR \fIvalue\fR
.fi
.SH "DESCRIPTION"
The \fBdnsadm\fR aims to be a simpler interface to \fBnsupdate\fR command
for use locally on a DNS zone master. In particular adding \fBPTR\fR records
can be made without using \fB.arpa\fR notation.
By default \fBdnsadm\fR runs \fBnsupdate\fR in local-only mode. In order for
local mode to work properly, \fBnsupdate\fR must be in your \fI$PATH\fR, you
must be able to read \fI/var/run/named.session.key\fR and each zone must be
configured for local updates. If the environment variable \fBTSIGKEY\fR is
set, then the defined key will be used in remote mode. In this mode, reqeusts
are sent to the server specified in the SOA record. See \fBnamed.conf(5)\fR for
details on configuring the update-policy.
E.g.:
.IP
.nf
\f[C]
zone\ "example.com"\ {
\ \ \ \ type\ master;
\ \ \ \ file\ "db.example.com";
\ \ \ \ update\-policy\ local;
};
\f[]
.fi
.SH SUBCOMMANDS
The following subcommands are supported:
.SS dnsadm add \fItype name value\fR
Add a new DNS record. If \fItype\fR is \fBPTR\fR then the value will
be converted to \fB.arpa\fR notation and used as the record name, while
\fIname\fR will be used as the FQDN record value.
.SS dnsadm del \fItype name\fR [ \fIvalue\fR ]
Remove an existing DNS record. If \fItype\fR is \fBPTR\fR then the value will
be converted to \fB.arpa\fR notation and used as the record name, while
\fIname\fR will be used as the FQDN record value. If \fIvalue\fR is not given
then \fBall\fR records for the name will be removed.
.SS dnsadm update \fItype name value\fR
Replace existing DNS record(s). Internally, this calls \fBdel\fR then \fBadd\fR.
An update action will delete \fBall\fR records matching \fIname\fR, replaced
with a single record with \fIvalue\fR as its value. For \fIPTR\fR records, both
\fIname\fR and \fIvalue\fR are required.
.SH EXAMPLES
.LP
IPv6 Records
.sp
.in +2
.nf
# \fBdnsadm add AAAA foo.example.com 2001:db8::200\fR
;RESULTS
;foo.example.com. IN A
foo.example.com. 3600 IN A 2001:db8::200
# \fBdnsadm update AAAA foo.example.com 2001:db8::201\fR
;RESULTS
;foo.example.com. IN A
foo.example.com. 3600 IN A 2001:db8::201
# \fBdnsadm del AAAA foo.example.com\fR
;RESULTS
;foo.example.com. IN A
.fi
.in -2
.sp
.LP
IPv4 Records
.sp
.in +2
.nf
# \fBdnsadm add A foo.example.com 198.51.100.200\fR
;RESULTS
;foo.example.com. IN A
foo.example.com. 3600 IN A 198.51.100.200
# \fBdnsadm update A foo.example.com 198.51.100.201\fR
;RESULTS
;foo.example.com. IN A
foo.example.com. 3600 IN A 198.51.100.201
# \fBdnsadm del A foo.example.com\fR
;RESULTS
;foo.example.com. IN A
.fi
.in -2
.sp
.LP
PTR in\-addr.arpa records
.sp
.in +2
.nf
# \fBdnsadm add PTR foo.example.com 198.51.100.200\fR
;RESULTS
;200.100.51.198.in\-addr.arpa. IN PTR
200.100.51.198.in\-addr.arpa. 3600 IN PTR foo.example.com.
# \fBdnsadm update PTR foo.example.com 198.51.100.201\fR
;RESULTS
;201.100.51.198.in\-addr.arpa. IN PTR
201.100.51.198.in\-addr.arpa. 3600 IN PTR foo.example.com.
# \fBdnsadm del PTR foo.example.com 198.51.100.201\fR
;RESULTS
;201.100.51.198.in\-addr.arpa. IN PTR
.fi
.ni -2
.sp
.LP
PTR ip6.arpa
.sp
.in +2
.nf
# \fBdnsadm add PTR foo.example.com 2001:db8::200\fR
;RESULTS
;0.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. IN PTR
0.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. 3600 IN PTR foo.example.com.
# \fBdnsadm update PTR foo.example.com 2001:db8::201\fR
;RESULTS
;1.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. IN PTR
1.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. 3600 IN PTR foo.example.com.
# \fBdnsadm del PTR foo.example.com 2001:db8::201\fR
;RESULTS
;1.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.\ IN\ PTR
.fi
.in -2
.sp
.SH BUGS
See \fIhttps://github.com/bahamat/dnsadm/issues\fR
.SH FILES
.PP
\fBnsupdate\fR
.RS
nsupdate binary wich must be in your $PATH
.RE
.PP
\fB/var/run/named/session.key\fR
.RS
TSIG key for use in local-only mode
.RE
.SH "SEE ALSO"
nsupdate(1)
named.conf(5)