· 6 years ago · Apr 23, 2020, 06:16 AM
1NS1 (master Auth Server) PDNS.CONF FIle
2=======================================
3
4# PowerDNS configuration file
5# Replace ns1.example.com with your primary nameserver's hostname
6default-soa-name = ns1.mydomainname.here
7# include-dir=/etc/powerdns/pdns.d
8include-dir = /usr/share/pdns-backend-mysql
9launch =
10security-poll-suffix =
11setgid = pdns
12setuid = pdns
13
14allow-axfr-ips = x.x.x.x << my slave NS2.mydomainname.here
15
16daemon = yes
17disable-axfr = no
18log-dns-details = yes
19prevent-self-notification = no
20# forward-notify = x.x.x.x <<< I was trying also to put the NS2 IP here ... without success
21
22default-soa-edit = INCEPTION-INCREMENT
23soa-refresh-default = 86400
24soa-retry-default = 7200
25soa-expire-default = 3600000
26soa-minimum-ttl = 172800
27
28# default-soa-edit-signed=INCEPTION-INCREMENT <<< useless
29
30api = yes
31# Replace <RANDOM_KEY> with a randomly generated key for API access
32api-key = e4--my-random-key-here-nf0
33webserver = yes
34master = yes
35slave = yes
36
37
38NS 1 (master) /usr/share/pdns-backend-mysql/pdns.local.gmysql.conf
39==================================================================
40
41# MySQL Configuration
42#
43# Launch gmysql backend
44launch+=gmysql
45
46# gmysql parameters
47gmysql-host = localhost
48gmysql-port = 3306
49gmysql-dbname = my-db-name
50gmysql-user = my-db-user
51gmysql-password = my-strong-password
52gmysql-dnssec = yes
53
54master = yes
55slave = no
56daemon = yes
57
58#gmysql-host=_DBC_DBSERVER_
59#gmysql-port=_DBC_DBPORT_
60#gmysql-dbname=_DBC_DBNAME_
61#gmysql-user=_DBC_DBUSER_
62#gmysql-password=_DBC_DBPASS_
63#gmysql-dnssec=yes
64# gmysql-socket=
65
66NS1 DOMAINS TABLE
67***********
68Database changed
69MariaDB [pdnsdb]> SELECT * FROM domains;
70+----+------------------------+--------+------------+--------+-----------------+---------+
71| id | name | master | last_check | type | notified_serial | account |
72+----+------------------------+--------+------------+--------+-----------------+---------+
73| 15 | testbruxelles.com | | NULL | NATIVE | NULL | |
74+----+------------------------+--------+------------+--------+-----------------+---------+
752 rows in set (0.000 sec)
76
77NS1 RECORDS
78***********
79MariaDB [pdnsdb]> SELECT * FROM records;
80+----+-----------+--------------------------------+------+--------------------------------------------------------------------------------------------+------+------+----------+-----------+------+
81| id | domain_id | name | type | content | ttl | prio | disabled | ordername | auth |
82+----+-----------+--------------------------------+------+--------------------------------------------------------------------------------------------+------+------+----------+-----------+------+
83| 47 | 15 | testbruxelles.com | NS | ns1.european-is.net | 3600 | 0 | 0 | | 1 |
84| 48 | 15 | testbruxelles.com | NS | ns2.european-is.net | 3600 | 0 | 0 | | 1 |
85| 50 | 15 | www.testbruxelles.com | A | SOME IP HERE | 3600 | 0 | 0 | NULL | 1 |
86| 52 | 15 | testbruxelles.com | A | SOME IP HERE | 3600 | 0 | 0 | | 1 |
87| 57 | 15 | trutezzz.testbruxelles.com | A | SOME IP HERE | 3600 | 0 | 0 | NULL | 1 |
88| 59 | 15 | castorpollux.testbruxelles.com | A | SOME IP HERE | 3600 | 0 | 0 | NULL | 1 |
89| 61 | 15 | testbruxelles.com | SOA | ns1.european-is.net hostmaster.testbruxelles.com 2020042301 86400 7200 3600000 172800 | 3600 | 0 | 0 | | 1 |
90+----+-----------+--------------------------------+------+--------------------------------------------------------------------------------------------+------+------+----------+-----------+------+
919 rows in set (0.000 sec)
92
93
94
95
96
97
98***************** END NS 1 CONFIGS ************
99
100NS2 (SLAVE Auth Server) PDNS.CONF File)
101=======================================
102
103# PowerDNS configuration file
104# Replace ns1.example.com with your primary nameserver's hostname
105# MICHEL ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++default-soa-name=ns1.european-is.net
106# include-dir=/etc/powerdns/pdns.d
107include-dir=/usr/share/pdns-backend-mysql
108launch=
109security-poll-suffix=
110setgid=pdns
111setuid=pdns
112
113master=no
114slave=yes
115
116superslave = yes
117
118NS 2 (SLAVE) /usr/share/pdns-backend-mysql/pdns.local.gmysql.conf
119==================================================================
120
121# MySQL Configuration
122#
123# Launch gmysql backend
124launch+=gmysql
125
126# gmysql parameters
127gmysql-host = localhost
128gmysql-port = 3306
129gmysql-dbname = my-db-name
130gmysql-user = my-db-user
131gmysql-password = my-strong-password
132gmysql-dnssec = yes
133
134
135master = no
136slave = yes
137daemon = yes
138
139# gmysql-socket=
140
141***************** END NS 2 CONFIGS ************
142
143NS2 DOMAINS TABLE
144***********
145Database changed
146MariaDB [pdnsdb]> SELECT * FROM domains;
147+----+------------------------+----------------+------------+--------+-----------------+---------+
148| id | name | master | last_check | type | notified_serial | account |
149+----+------------------------+----------------+------------+--------+-----------------+---------+
150| 6 | testbruxelles.com | NS1 IP HERE | 1587564533 | SLAVE | NULL | admin |
151+----+------------------------+----------------+------------+--------+-----------------+---------+
152
153
154NS2 RECORDS TABLE
155***********
156MariaDB [pdnsdb]> SELECT * FROM records;
157
158NOTE: (when notified manualy with pdns_control notify-host testbruxelles.com IP-SLAVE-SERVER ... it's working fine)
159but when adding/modifying a domain on NS1 ... no notification of NS is happening !!!
160
161| 33 | 6 | testbruxelles.com | SOA | ns1.european-is.net hostmaster.testbruxelles.com 2020042204 86400 7200 3600000 172800 | 3600 | 0 | 0 | NULL | 1 |
162| 34 | 6 | testbruxelles.com | A | SOME IP HERE | 3600 | 0 | 0 | NULL | 1 |
163| 35 | 6 | testbruxelles.com | NS | ns1.european-is.net | 3600 | 0 | 0 | NULL | 1 |
164| 36 | 6 | testbruxelles.com | NS | ns2.european-is.net | 3600 | 0 | 0 | NULL | 1 |
165| 37 | 6 | www.testbruxelles.com | A | SOME IP HERE | 3600 | 0 | 0 | NULL | 1 |
166+----+-----------+------------------------+------+--------------------------------------------------------------------------------------------+------+------+----------+-----------+------+
16715 rows in set (0.000 sec)