소스 검색

pdns recursor

tags/v1.0.0^0
Robin Thoni 8 년 전
부모
커밋
f630372ff3

+ 10
- 10
docker-compose.yml 파일 보기

@@ -38,16 +38,16 @@ services:
38 38
             - "0.0.0.0:53:53/udp"
39 39
         env_file:
40 40
             - env
41
-#
42
-#    pdns-recursor:
43
-#      build: ./pdns-recursor
44
-#      container_name: pdns-pdns-recursor
45
-#        networks:
46
-#            pdns.internal.docker:
47
-#                aliases:
48
-#                  - pdns-recursor.pdns.internal.docker
49
-#        env_file:
50
-#            - env
41
+
42
+    pdns-recursor:
43
+        build: ./pdns-recursor
44
+        container_name: pdns-pdns-recursor
45
+        networks:
46
+            pdns.internal.docker:
47
+                aliases:
48
+                    - pdns-recursor.pdns.internal.docker
49
+        env_file:
50
+            - env
51 51
 
52 52
 
53 53
 networks:

+ 23
- 0
pdns-recursor/Dockerfile 파일 보기

@@ -0,0 +1,23 @@
1
+FROM debian:jessie
2
+
3
+MAINTAINER Robin Thoni <robin@rthoni.com>
4
+
5
+RUN DEBIAN_FRONTEND=noninteractive apt-get update &&\
6
+    apt-get install -y pdns-recursor &&\
7
+    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
8
+
9
+RUN rm -rf /etc/powerdns/*
10
+
11
+RUN rm -rf /var/log/*
12
+
13
+COPY ./config/ /etc/powerdns/
14
+
15
+COPY ./vars-vars /etc/vars-vars
16
+
17
+COPY ./vars-files /etc/vars-files
18
+
19
+COPY ./run.sh /run.sh
20
+
21
+EXPOSE 53/udp
22
+
23
+CMD ["/run.sh"]

+ 303
- 0
pdns-recursor/config/recursor.conf 파일 보기

@@ -0,0 +1,303 @@
1
+# Autogenerated configuration file template
2
+#################################
3
+# aaaa-additional-processing    turn on to do AAAA additional processing (slow)
4
+#
5
+# aaaa-additional-processing=off
6
+
7
+#################################
8
+# allow-from    If set, only allow these comma separated netmasks to recurse
9
+#
10
+# allow-from=127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10
11
+
12
+#################################
13
+# allow-from-file       If set, load allowed netmasks from this file
14
+#
15
+# allow-from-file=
16
+
17
+#################################
18
+# auth-can-lower-ttl    If we follow RFC 2181 to the letter, an authoritative server can lower the TTL of NS records
19
+#
20
+# auth-can-lower-ttl=off
21
+
22
+#################################
23
+# auth-zones    Zones for which we have authoritative data, comma separated domain=file pairs 
24
+#
25
+# auth-zones=
26
+
27
+#################################
28
+# chroot        switch to chroot jail
29
+#
30
+# chroot=
31
+
32
+#################################
33
+# client-tcp-timeout    Timeout in seconds when talking to TCP clients
34
+#
35
+# client-tcp-timeout=2
36
+
37
+#################################
38
+# config-dir    Location of configuration directory (recursor.conf)
39
+#
40
+# config-dir=/etc/powerdns/
41
+
42
+#################################
43
+# daemon        Operate as a daemon
44
+#
45
+# daemon=yes
46
+
47
+#################################
48
+# delegation-only       Which domains we only accept delegations from
49
+#
50
+# delegation-only=
51
+
52
+#################################
53
+# disable-edns  Disable EDNS
54
+#
55
+# disable-edns=
56
+
57
+#################################
58
+# disable-edns-ping     Disable EDNSPing
59
+#
60
+# disable-edns-ping=no
61
+
62
+#################################
63
+# disable-packetcache   Disable packetcache
64
+#
65
+# disable-packetcache=no
66
+
67
+#################################
68
+# dont-query    If set, do not query these netmasks for DNS data
69
+#
70
+# dont-query=127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10
71
+
72
+#################################
73
+# entropy-source        If set, read entropy from this file
74
+#
75
+# entropy-source=/dev/urandom
76
+
77
+#################################
78
+# etc-hosts-file        Path to 'hosts' file
79
+#
80
+# etc-hosts-file=/etc/hosts
81
+
82
+#################################
83
+# export-etc-hosts      If we should serve up contents from /etc/hosts
84
+#
85
+# export-etc-hosts=off
86
+
87
+#################################
88
+# forward-zones Zones for which we forward queries, comma separated domain=ip pairs
89
+#
90
+# forward-zones=
91
+
92
+#################################
93
+# forward-zones-file    File with (+)domain=ip pairs for forwarding
94
+#
95
+# forward-zones-file=
96
+
97
+#################################
98
+# forward-zones-recurse Zones for which we forward queries with recursion bit, comma separated domain=ip pairs
99
+#
100
+# forward-zones-recurse=
101
+
102
+#################################
103
+# hint-file     If set, load root hints from this file
104
+#
105
+# hint-file=
106
+
107
+#################################
108
+# ignore-rd-bit Assume each packet requires recursion, for compatability
109
+#
110
+# ignore-rd-bit=off
111
+
112
+#################################
113
+# local-address IP addresses to listen on, separated by spaces or commas. Also accepts ports.
114
+#
115
+local-address=0.0.0.0
116
+
117
+#################################
118
+# local-port    port to listen on
119
+#
120
+local-port=53
121
+
122
+#################################
123
+# log-common-errors     If we should log rather common errors
124
+#
125
+# log-common-errors=yes
126
+
127
+#################################
128
+# logging-facility      Facility to log messages as. 0 corresponds to local0
129
+#
130
+# logging-facility=
131
+
132
+#################################
133
+# lua-dns-script        Filename containing an optional 'lua' script that will be used to modify dns answers
134
+#
135
+# lua-dns-script=
136
+
137
+#################################
138
+# max-cache-entries     If set, maximum number of entries in the main cache
139
+#
140
+# max-cache-entries=1000000
141
+
142
+#################################
143
+# max-cache-ttl maximum number of seconds to keep a cached entry in memory
144
+#
145
+# max-cache-ttl=86400
146
+
147
+#################################
148
+# max-mthreads  Maximum number of simultaneous Mtasker threads
149
+#
150
+# max-mthreads=2048
151
+
152
+#################################
153
+# max-negative-ttl      maximum number of seconds to keep a negative cached entry in memory
154
+#
155
+# max-negative-ttl=3600
156
+
157
+#################################
158
+# max-packetcache-entries       maximum number of entries to keep in the packetcache
159
+#
160
+# max-packetcache-entries=500000
161
+
162
+#################################
163
+# max-tcp-clients       Maximum number of simultaneous TCP clients
164
+#
165
+# max-tcp-clients=128
166
+
167
+#################################
168
+# max-tcp-per-client    If set, maximum number of TCP sessions per client (IP address)
169
+#
170
+# max-tcp-per-client=0
171
+
172
+#################################
173
+# network-timeout       Wait this nummer of milliseconds for network i/o
174
+#
175
+# network-timeout=1500
176
+
177
+#################################
178
+# no-shuffle    Don't change
179
+#
180
+# no-shuffle=off
181
+
182
+#################################
183
+# packetcache-servfail-ttl      maximum number of seconds to keep a cached servfail entry in packetcache
184
+#
185
+# packetcache-servfail-ttl=60
186
+
187
+#################################
188
+# packetcache-ttl       maximum number of seconds to keep a cached entry in packetcache
189
+#
190
+# packetcache-ttl=3600
191
+
192
+#################################
193
+# pdns-distributes-queries      If PowerDNS itself should distribute queries over threads (EXPERIMENTAL)
194
+#
195
+# pdns-distributes-queries=no
196
+
197
+#################################
198
+# processes     Launch this number of processes (EXPERIMENTAL, DO NOT CHANGE)
199
+#
200
+# processes=1
201
+
202
+#################################
203
+# query-local-address   Source IP address for sending queries
204
+#
205
+# query-local-address=0.0.0.0
206
+
207
+#################################
208
+# query-local-address6  Source IPv6 address for sending queries
209
+#
210
+# query-local-address6=
211
+
212
+#################################
213
+# quiet Suppress logging of questions and answers
214
+#
215
+quiet=yes
216
+
217
+#################################
218
+# remotes-ringbuffer-entries    maximum number of packets to store statistics for
219
+#
220
+# remotes-ringbuffer-entries=0
221
+
222
+#################################
223
+# serve-rfc1918 If we should be authoritative for RFC 1918 private IP space
224
+#
225
+# serve-rfc1918=
226
+
227
+#################################
228
+# server-id     Returned when queried for 'server.id' TXT or NSID, defaults to hostname
229
+#
230
+# server-id=
231
+
232
+#################################
233
+# setgid        If set, change group id to this gid for more security
234
+#
235
+setgid=pdns
236
+
237
+#################################
238
+# setuid        If set, change user id to this uid for more security
239
+#
240
+setuid=pdns
241
+
242
+#################################
243
+# single-socket If set, only use a single socket for outgoing queries
244
+#
245
+# single-socket=off
246
+
247
+#################################
248
+# soa-minimum-ttl       Don't change
249
+#
250
+# soa-minimum-ttl=0
251
+
252
+#################################
253
+# soa-serial-offset     Don't change
254
+#
255
+# soa-serial-offset=0
256
+
257
+#################################
258
+# socket-dir    Where the controlsocket will live
259
+#
260
+# socket-dir=/var/run/
261
+
262
+#################################
263
+# socket-group  Group of socket
264
+#
265
+# socket-group=
266
+
267
+#################################
268
+# socket-mode   Permissions for socket
269
+#
270
+# socket-mode=
271
+
272
+#################################
273
+# socket-owner  Owner of socket
274
+#
275
+# socket-owner=
276
+
277
+#################################
278
+# spoof-nearmiss-max    If non-zero, assume spoofing after this many near misses
279
+#
280
+# spoof-nearmiss-max=20
281
+
282
+#################################
283
+# stack-size    stack size per mthread
284
+#
285
+# stack-size=200000
286
+
287
+#################################
288
+# threads       Launch this number of threads
289
+#
290
+# threads=2
291
+
292
+#################################
293
+# trace if we should output heaps of logging
294
+#
295
+# trace=off
296
+
297
+#################################
298
+# version-string        string reported on version.pdns or version.bind
299
+#
300
+# version-string=PowerDNS Recursor 3.3 $Id: pdns_recursor.cc 1712 2010-09-11 13:40:03Z ahu $
301
+
302
+
303
+

+ 29
- 0
pdns-recursor/run.sh 파일 보기

@@ -0,0 +1,29 @@
1
+#! /usr/bin/env bash
2
+
3
+replace_var()
4
+{
5
+  file="${1}"
6
+  var="${2}"
7
+  sed -e "s?${var}?${!var}?g" -i "${file}"
8
+}
9
+
10
+replace_vars()
11
+{
12
+  file="${1}"
13
+  for var in $(cat /etc/vars-vars)
14
+  do
15
+    replace_var "${file}" "${var}"
16
+  done
17
+}
18
+
19
+replace_files()
20
+{
21
+  for file in $(cat /etc/vars-files)
22
+  do
23
+    replace_vars "${file}"
24
+  done
25
+}
26
+
27
+replace_files
28
+
29
+pdns_recursor --daemon=no

+ 2
- 0
pdns-recursor/vars-files 파일 보기

@@ -0,0 +1,2 @@
1
+/etc/powerdns/pdns.d/pdns.local.gpgsql.conf
2
+/etc/powerdns/pdns.conf

+ 12
- 0
pdns-recursor/vars-vars 파일 보기

@@ -0,0 +1,12 @@
1
+POSTGRES_HOST
2
+POSTGRES_USER
3
+POSTGRES_PASSWORD
4
+POSTGRES_DB
5
+
6
+PDNS_RECURSOR_HOST
7
+
8
+SESSION_KEY
9
+
10
+DNS_HOSTMASTER
11
+DNS_NS1
12
+DNS_NS2

+ 2
- 7
pdns/Dockerfile 파일 보기

@@ -7,17 +7,12 @@ COPY ./preseed.txt /tmp/preseed.txt
7 7
 RUN debconf-set-selections /tmp/preseed.txt
8 8
 
9 9
 RUN DEBIAN_FRONTEND=noninteractive apt-get update &&\
10
-    apt-get install -y pdns-server pdns-backend-pgsql rsyslog &&\
10
+    apt-get install -y pdns-server pdns-backend-pgsql &&\
11 11
     apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
12 12
 
13 13
 RUN rm -rf /etc/powerdns/*
14 14
 
15
-RUN rm -rf /var/log/* &&\
16
-    mkfifo /var/log/mail.info &&\
17
-    ln -s /dev/null /var/log/mail.log &&\
18
-    ln -s /dev/stderr /var/log/mail.err &&\
19
-    ln -s /dev/null /var/log/syslog &&\
20
-    ln -s /dev/null /var/log/messages
15
+RUN rm -rf /var/log/*
21 16
 
22 17
 COPY ./config/ /etc/powerdns/
23 18
 

+ 5
- 5
pdns/config/pdns.conf 파일 보기

@@ -1,7 +1,7 @@
1 1
 #################################
2 2
 # allow-axfr-ips	Allow zonetransfers only to these subnets
3 3
 #
4
-allow-axfr-ips=10.15.42.0/24
4
+# allow-axfr-ips=
5 5
 
6 6
 #################################
7 7
 # allow-dnsupdate-from	A global setting to allow DNS updates from these IP ranges.
@@ -11,12 +11,12 @@ allow-axfr-ips=10.15.42.0/24
11 11
 #################################
12 12
 # allow-recursion	List of subnets that are allowed to recurse
13 13
 #
14
-allow-recursion=178.170.0.0/16,127.0.0.1,213.246.52.61,52.28.227.93,52.58.80.7,10.15.42.0/24,10.8.0.0/24
14
+allow-recursion=127.0.0.1,172.0.0.0/8,192.168.0.0/16
15 15
 
16 16
 #################################
17 17
 # also-notify	When notifying a domain, also notify these nameservers
18 18
 #
19
-also-notify=10.15.42.6,10.15.42.15,10.15.42.16,10.15.42.17,10.15.42.18
19
+# also-notify=
20 20
 
21 21
 #################################
22 22
 # any-to-tcp	Answer ANY queries with tc=1, shunting to TCP
@@ -66,7 +66,7 @@ config-dir=/etc/powerdns
66 66
 #################################
67 67
 # daemon	Operate as a daemon
68 68
 #
69
-daemon=yes
69
+# daemon=yes
70 70
 
71 71
 #################################
72 72
 # default-ksk-algorithms	Default KSK algorithms
@@ -363,7 +363,7 @@ master=yes
363 363
 #################################
364 364
 # recursor	If recursion is desired, IP address of a recursing nameserver
365 365
 #
366
-recursor=127.0.0.1:54
366
+recursor=PDNS_RECURSOR_HOST:53
367 367
 
368 368
 #################################
369 369
 # retrieval-threads	Number of AXFR-retrieval threads for slave operation

+ 3
- 6
pdns/run.sh 파일 보기

@@ -1,5 +1,7 @@
1 1
 #! /usr/bin/env bash
2 2
 
3
+export PDNS_RECURSOR_HOST="$(getent hosts ${PDNS_RECURSOR_HOST} | cut -d' ' -f1)"
4
+
3 5
 replace_var()
4 6
 {
5 7
   file="${1}"
@@ -26,9 +28,4 @@ replace_files()
26 28
 
27 29
 replace_files
28 30
 
29
-
30
-rm -f /var/run/rsyslogd.pid
31
-service rsyslog start &&
32
-service pdns start &&
33
-
34
-sleep 3600
31
+pdns_server --daemon=no

+ 1
- 0
pdns/vars-files 파일 보기

@@ -1 +1,2 @@
1 1
 /etc/powerdns/pdns.d/pdns.local.gpgsql.conf
2
+/etc/powerdns/pdns.conf

+ 0
- 1
poweradmin/poweradmin-2.1.7/.gitignore 파일 보기

@@ -1,4 +1,3 @@
1
-inc/config.inc.php
2 1
 .DS_Store
3 2
 /nbproject
4 3
 /scripts

+ 16
- 0
poweradmin/poweradmin-2.1.7/inc/config.inc.php 파일 보기

@@ -0,0 +1,16 @@
1
+<?php
2
+
3
+$db_host    = 'POSTGRES_HOST';
4
+$db_user    = 'POSTGRES_USER';
5
+$db_pass    = 'POSTGRES_PASSWORD';
6
+$db_name    = 'POSTGRES_DB';
7
+$db_type    = 'pgsql';
8
+$db_layer   = 'PDO';
9
+
10
+$session_key    = 'SESSION_KEY';
11
+
12
+$iface_lang   = 'en_EN';
13
+
14
+$dns_hostmaster   = 'DNS_HOSTMASTER';
15
+$dns_ns1    = 'DNS_NS1';
16
+$dns_ns2    = 'DNS_NS2';

Loading…
취소
저장