-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path19 ¿Cómo instalar PowerDNS siguiendo la guía de Rithvik Vibhu pero con versión 4.7 en nuestro VPS Ubuntu 20.04 LTS?
237 lines (174 loc) · 11.1 KB
/
19 ¿Cómo instalar PowerDNS siguiendo la guía de Rithvik Vibhu pero con versión 4.7 en nuestro VPS Ubuntu 20.04 LTS?
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
¿Cómo instalar PowerDNS siguiendo la guía de Rithvik Vibhu pero con versión 4.7 en nuestro VPS Ubuntu 20.04 LTS?
Añadimos la repo:
sudo sh -c "echo 'deb [arch=amd64] http://repo.powerdns.com/ubuntu focal-auth-47 main' > /etc/apt/sources.list.d/pdns.list"
sudo sh -c "echo 'Package: pdns-*\nPin: origin repo.powerdns.com\nPin-Priority: 600' > /etc/apt/preferences.d/pdns"
curl https://repo.powerdns.com/FD380FBB-pub.asc | sudo apt-key add - &&
sudo apt-get update &&
sudo apt-get install sqlite3 pdns-server pdns-backend-sqlite3 -y
Con todo esto la consola quedará tal que así:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
next@server:~$ sudo sh -c "echo 'deb [arch=amd64] http://repo.powerdns.com/ubuntu focal-auth-47 main' > /etc/apt/sources.list.d/pdns.list"
[sudo] password for next:
next@server:~$ sudo sh -c "echo 'Package: pdns-*\nPin: origin repo.powerdns.com\nPin-Priority: 600' > /etc/apt/preferences.d/pdns"
next@server:~$ curl https://repo.powerdns.com/FD380FBB-pub.asc | sudo apt-key add - &&
> sudo apt-get update &&
>
next@server:~$ curl https://repo.powerdns.com/FD380FBB-pub.asc | sudo apt-key add - &&
> sudo apt-get update &&
> sudo apt-get install sqlite3 pdns-server pdns-backend-sqlite3 -y
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1678 100 1678 0 0 16134 0 --:--:-- --:--:-- --:--:-- 16134
OK
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://repo.powerdns.com/ubuntu focal-auth-47 InRelease [1814 B]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1342 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [233 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [40.7 kB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [9800 B]
Get:9 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [825 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [117 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [692 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [121 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [66.5 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [14.1 kB]
Get:15 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [2464 B]
Get:16 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:17 http://repo.powerdns.com/ubuntu focal-auth-47/main amd64 Packages [6555 B]
Get:18 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1669 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [278 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [14.8 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [910 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [202 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [390 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [20.3 kB]
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [24.5 kB]
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Get:27 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [7988 B]
Get:28 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.8 kB]
Fetched 7356 kB in 3s (2870 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libboost-program-options1.71.0 libluajit-5.1-2 libluajit-5.1-common pdns-backend-bind
Suggested packages:
sqlite3-doc
The following NEW packages will be installed:
libboost-program-options1.71.0 libluajit-5.1-2 libluajit-5.1-common pdns-backend-bind pdns-backend-sqlite3 pdns-server sqlite3
0 upgraded, 7 newly installed, 0 to remove and 2 not upgraded.
Need to get 4023 kB of archives.
After this operation, 19.3 MB of additional disk space will be used.
Get:1 http://repo.powerdns.com/ubuntu focal-auth-47/main amd64 pdns-server amd64 4.7.0~alpha1-1pdns.focal [2422 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 libboost-program-options1.71.0 amd64 1.71.0-6ubuntu6 [342 kB]
Get:3 http://repo.powerdns.com/ubuntu focal-auth-47/main amd64 pdns-backend-bind amd64 4.7.0~alpha1-1pdns.focal [100 kB]
Get:4 http://repo.powerdns.com/ubuntu focal-auth-47/main amd64 pdns-backend-sqlite3 amd64 4.7.0~alpha1-1pdns.focal [26.1 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal/universe amd64 libluajit-5.1-common all 2.1.0~beta3+dfsg-5.1build1 [44.3 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 libluajit-5.1-2 amd64 2.1.0~beta3+dfsg-5.1build1 [228 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 sqlite3 amd64 3.31.1-4ubuntu0.2 [860 kB]
Fetched 4023 kB in 1s (3636 kB/s)
Selecting previously unselected package libboost-program-options1.71.0:amd64.
(Reading database ... 168360 files and directories currently installed.)
Preparing to unpack .../0-libboost-program-options1.71.0_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost-program-options1.71.0:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package libluajit-5.1-common.
Preparing to unpack .../1-libluajit-5.1-common_2.1.0~beta3+dfsg-5.1build1_all.deb ...
Unpacking libluajit-5.1-common (2.1.0~beta3+dfsg-5.1build1) ...
Selecting previously unselected package libluajit-5.1-2:amd64.
Preparing to unpack .../2-libluajit-5.1-2_2.1.0~beta3+dfsg-5.1build1_amd64.deb ...
Unpacking libluajit-5.1-2:amd64 (2.1.0~beta3+dfsg-5.1build1) ...
Selecting previously unselected package pdns-server.
Preparing to unpack .../3-pdns-server_4.7.0~alpha1-1pdns.focal_amd64.deb ...
Unpacking pdns-server (4.7.0~alpha1-1pdns.focal) ...
Selecting previously unselected package pdns-backend-bind.
Preparing to unpack .../4-pdns-backend-bind_4.7.0~alpha1-1pdns.focal_amd64.deb ...
Unpacking pdns-backend-bind (4.7.0~alpha1-1pdns.focal) ...
Selecting previously unselected package pdns-backend-sqlite3.
Preparing to unpack .../5-pdns-backend-sqlite3_4.7.0~alpha1-1pdns.focal_amd64.deb ...
Unpacking pdns-backend-sqlite3 (4.7.0~alpha1-1pdns.focal) ...
Selecting previously unselected package sqlite3.
Preparing to unpack .../6-sqlite3_3.31.1-4ubuntu0.2_amd64.deb ...
Unpacking sqlite3 (3.31.1-4ubuntu0.2) ...
Setting up libluajit-5.1-common (2.1.0~beta3+dfsg-5.1build1) ...
Setting up sqlite3 (3.31.1-4ubuntu0.2) ...
Setting up libboost-program-options1.71.0:amd64 (1.71.0-6ubuntu6) ...
Setting up libluajit-5.1-2:amd64 (2.1.0~beta3+dfsg-5.1build1) ...
Setting up pdns-server (4.7.0~alpha1-1pdns.focal) ...
Created symlink /etc/systemd/system/multi-user.target.wants/pdns.service → /lib/systemd/system/pdns.service.
Job for pdns.service failed because the control process exited with error code.
See "systemctl status pdns.service" and "journalctl -xe" for details.
Setting up pdns-backend-sqlite3 (4.7.0~alpha1-1pdns.focal) ...
Setting up pdns-backend-bind (4.7.0~alpha1-1pdns.focal) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.7) ...
Processing triggers for pdns-server (4.7.0~alpha1-1pdns.focal) ...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Comprobamos el estado de PowerDNS
sudo systemctl status pdns
● pdns.service - PowerDNS Authoritative Server
Loaded: loaded (/lib/systemd/system/pdns.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-03-22 17:49:10 CET; 1min 33s ago
Nos aseguramos de que el piloto es de color verde.
Y editamos la base de datos:
sudo nano /etc/powerdns/pdns.conf
En medio del archivo hay un "launch=" Borradlo!
Y poner estas 3 líneas al principo de todo el archivo.
launch=gsqlite3
gsqlite3-database=/var/lib/powerdns/pdns.sqlite3
gsqlite3-dnssec=yes
Y ejecutamos el proceso de guardado ya mencionado al principio de la guía.
Ejecutamos:
sudo sqlite3 /var/lib/powerdns/pdns.sqlite3 < /usr/share/doc/pdns-backend-sqlite3/schema.sqlite3.sql
Si es correcto, la consola no devolverá nada!
Ejecutamos:
sudo chown -R pdns:pdns /var/lib/powerdns
Si es correcto, la consola no devolverá nada!
Ejecutamos:
sudo systemctl restart pdns
Si es correcto, la consola no devolverá nada!
Comprobamos el estado de pdns:
sudo systemctl status pdns
● pdns.service - PowerDNS Authoritative Server
Loaded: loaded (/lib/systemd/system/pdns.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-03-22 17:55:36 CET; 26s ago
Nos aseguramos de que tenga un piloto verde.
Aquí abajo dejo una chuleta para comandos:
PowerDNS pdnsutil cheat sheet
PowerDNS logo
This is an extremely simple tutorial on how to enter data into the PowerDNS Authoritative Server using the command line "pdnsutil" tool. The guide is written in the "walk through" format: create zone - add data - update serial.
New Tutorial Now Available PowerDNS export from MySQL to csv using command line - 8 Feb 2022
CREATE ZONE
pdnsutil create-zone example.com
ADD DATA TO ZONE // Let's start by adding the root A-record and AAAA for IPv6 (makarainen.net)
pdnsutil add-record example.com @ A 192.168.1.2
pdnsutil add-record example.com @ AAAA 2a01:4f9:c010:30f4::1
ADD DATA TO ZONE // adding a subdomain (www)
pdnsutil add-record example.com www A 192.168.1.2
ADD DATA TO ZONE // every domain needs name servers
pdnsutil add-record example.com @ NS ns1.example.com
ADD DATA TO ZONE
pdnsutil add-record example.com @ MX "10 example.com"
pdnsutil add-record example.com 3600 TXT "google-site-verification=example-id"
MANAGE ZONES // check the information provided
pdnsutil list-zone example.com
MANAGE ZONES // modify the zone (if changes do not miss update serial -> UPDATE SERIAL)
pdnsutil edit-zone example.com
MANAGE ZONES
pdnsutil check-all-zones
pdnsutil show-zone example.com
DELETE A SPECIFIC ZONE
pdnsutil delete-zone example.com
UPDATE SERIAL
pdnsutil increase-serial example.com
UPDATE THE CONNECTED DNS SERVERS
pdns_control notify example.com
START THE POWERDNS SERVER IN UBUNTU
service pdns start
Questions
Where do I enter a SOA-record? - No, you don't have to enter it. PowerDNS generates it automatically when you update the serial. However, specify initialization values in the /etc/powerdns/pdns.conf file.
Noteworthy deal
Domainparkki may be able to help if you need plain name server services for hobby/low volume use. Only 5 euros +VAT per zone per year. One zone = one domain, including 20 records per zone and 1 billion queries per month (excess traffic is billed separately). Open the link above and check it out. Inquiries by email [email protected].
// viHannes, 12 Feb 2022 in Helsinki, Finland