Skip to content

Commit 483c793

Browse files
committed
Fixed #16
1 parent 3228096 commit 483c793

File tree

3 files changed

+327
-12
lines changed

3 files changed

+327
-12
lines changed

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ Namingo Domain Manager is a powerful and flexible tool for managing **DNS zones*
1515

1616
**Fast and secure** – Uses API keys for authentication and ensures secure communication.
1717

18-
## Supported Providers & Requirements
18+
## Supported Providers
1919
Namingo Domain Manager supports the following **DNS providers**, each requiring specific credentials:
2020

21-
| Provider | Credentials in .env | Requirements | Status | DNSSEC |
22-
|------------|---------------------|------------|---------------------|---------------------|
23-
| **AnycastDNS** | `API_KEY` | | ||
24-
| **Bind9** | `API_KEY:BIND_IP` | [bind9-api-server](https://github.com/getnamingo/bind9-api-server)/[bind9-api-server-sqlite](https://github.com/getnamingo/bind9-api-server-sqlite) | | 🚧 |
25-
| **Cloudflare** | `EMAIL:API_KEY` or `API_TOKEN` | | ||
26-
| **ClouDNS** | `AUTH_ID:AUTH_PASSWORD` | | ||
27-
| **Desec** | `API_KEY` | | ||
28-
| **DNSimple** | `API_KEY` | | ||
29-
| **Hetzner** | `API_KEY` | | 🚧 ||
30-
| **PowerDNS** | `API_KEY:POWERDNS_IP` | gmysql-dnssec=yes in pdns.conf | ||
31-
| **Vultr** | `API_KEY` | | ||
21+
| Provider | Credentials | Status | DNSSEC |
22+
|------------|---------------------|------------|---------------------|
23+
| **AnycastDNS** | `API_KEY` |||
24+
| **Bind9** | `API_KEY:BIND_IP` || 🚧 |
25+
| **Cloudflare** | `EMAIL:API_KEY` or `API_TOKEN` |||
26+
| **ClouDNS** | `AUTH_ID:AUTH_PASSWORD` |||
27+
| **Desec** | `API_KEY` |||
28+
| **DNSimple** | `API_KEY` |||
29+
| **Hetzner** | `API_KEY` | 🚧 ||
30+
| **PowerDNS** | `API_KEY:POWERDNS_IP` |||
31+
| **Vultr** | `API_KEY` |||
3232

3333
## Documentation
3434

@@ -44,6 +44,12 @@ bash <(wget -qO- https://raw.githubusercontent.com/getnamingo/dnspanel/refs/head
4444

4545
For detailed installation steps, see [install.md](docs/install.md)
4646

47+
### Configuration
48+
49+
After installation, configure your DNS providers and nameservers using `.env`.
50+
51+
See the full configuration guide at [Configuration Guide](docs/configuration.md)
52+
4753
### Update
4854

4955
To get started, copy the command below and paste it into your server terminal:

app/Controllers/ZonesController.php

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,26 @@ public function createZone(Request $request, Response $response)
265265
}
266266
if ($powerdnsip !== '127.0.0.1' && isValidIP($powerdnsip)) {
267267
$config['powerdnsip'] = $powerdnsip;
268+
$config['pdns_master_ip'] = $powerdnsip;
269+
}
270+
// NS2–NS13 (slaves)
271+
for ($i = 2; $i <= 13; $i++) {
272+
$suffix = '_NS' . $i;
273+
274+
$apiKeyKey = 'API_KEY' . $suffix;
275+
if (!empty($credentials[$apiKeyKey])) {
276+
$config['apikey_ns' . $i] = $credentials[$apiKeyKey];
277+
}
278+
279+
$bindKey = 'BIND_IP' . $suffix;
280+
if (!empty($credentials[$bindKey]) && isValidIP($credentials[$bindKey])) {
281+
$config['bindip_ns' . $i] = $credentials[$bindKey];
282+
}
283+
284+
$pdnsKey = 'POWERDNS_IP' . $suffix;
285+
if (!empty($credentials[$pdnsKey]) && isValidIP($credentials[$pdnsKey])) {
286+
$config['powerdnsip_ns' . $i] = $credentials[$pdnsKey];
287+
}
268288
}
269289
if ($providerDisplay === 'ClouDNS') {
270290
$config['cloudns_auth_id'] = $cloudnsAuthId;
@@ -617,6 +637,26 @@ public function zoneDNSSEC(Request $request, Response $response, $args)
617637
}
618638
if ($powerdnsip !== '127.0.0.1' && isValidIP($powerdnsip)) {
619639
$recordData['powerdnsip'] = $powerdnsip;
640+
$recordData['pdns_master_ip'] = $powerdnsip;
641+
}
642+
// NS2–NS13 (slaves)
643+
for ($i = 2; $i <= 13; $i++) {
644+
$suffix = '_NS' . $i;
645+
646+
$apiKeyKey = 'API_KEY' . $suffix;
647+
if (!empty($credentials[$apiKeyKey])) {
648+
$recordData['apikey_ns' . $i] = $credentials[$apiKeyKey];
649+
}
650+
651+
$bindKey = 'BIND_IP' . $suffix;
652+
if (!empty($credentials[$bindKey]) && isValidIP($credentials[$bindKey])) {
653+
$recordData['bindip_ns' . $i] = $credentials[$bindKey];
654+
}
655+
656+
$pdnsKey = 'POWERDNS_IP' . $suffix;
657+
if (!empty($credentials[$pdnsKey]) && isValidIP($credentials[$pdnsKey])) {
658+
$recordData['powerdnsip_ns' . $i] = $credentials[$pdnsKey];
659+
}
620660
}
621661
if ($providerDisplay === 'ClouDNS') {
622662
$recordData['cloudns_auth_id'] = $cloudnsAuthId;
@@ -805,6 +845,26 @@ public function updateZone(Request $request, Response $response, $args)
805845
}
806846
if ($powerdnsip !== '127.0.0.1' && isValidIP($powerdnsip)) {
807847
$recordData['powerdnsip'] = $powerdnsip;
848+
$recordData['pdns_master_ip'] = $powerdnsip;
849+
}
850+
// NS2–NS13 (slaves)
851+
for ($i = 2; $i <= 13; $i++) {
852+
$suffix = '_NS' . $i;
853+
854+
$apiKeyKey = 'API_KEY' . $suffix;
855+
if (!empty($credentials[$apiKeyKey])) {
856+
$recordData['apikey_ns' . $i] = $credentials[$apiKeyKey];
857+
}
858+
859+
$bindKey = 'BIND_IP' . $suffix;
860+
if (!empty($credentials[$bindKey]) && isValidIP($credentials[$bindKey])) {
861+
$recordData['bindip_ns' . $i] = $credentials[$bindKey];
862+
}
863+
864+
$pdnsKey = 'POWERDNS_IP' . $suffix;
865+
if (!empty($credentials[$pdnsKey]) && isValidIP($credentials[$pdnsKey])) {
866+
$recordData['powerdnsip_ns' . $i] = $credentials[$pdnsKey];
867+
}
808868
}
809869
if ($providerDisplay === 'ClouDNS') {
810870
$recordData['cloudns_auth_id'] = $cloudnsAuthId;
@@ -1050,6 +1110,26 @@ public function updateZoneProcess(Request $request, Response $response)
10501110
}
10511111
if ($powerdnsip !== '127.0.0.1' && isValidIP($powerdnsip)) {
10521112
$recordData['powerdnsip'] = $powerdnsip;
1113+
$recordData['pdns_master_ip'] = $powerdnsip;
1114+
}
1115+
// NS2–NS13 (slaves)
1116+
for ($i = 2; $i <= 13; $i++) {
1117+
$suffix = '_NS' . $i;
1118+
1119+
$apiKeyKey = 'API_KEY' . $suffix;
1120+
if (!empty($credentials[$apiKeyKey])) {
1121+
$recordData['apikey_ns' . $i] = $credentials[$apiKeyKey];
1122+
}
1123+
1124+
$bindKey = 'BIND_IP' . $suffix;
1125+
if (!empty($credentials[$bindKey]) && isValidIP($credentials[$bindKey])) {
1126+
$recordData['bindip_ns' . $i] = $credentials[$bindKey];
1127+
}
1128+
1129+
$pdnsKey = 'POWERDNS_IP' . $suffix;
1130+
if (!empty($credentials[$pdnsKey]) && isValidIP($credentials[$pdnsKey])) {
1131+
$recordData['powerdnsip_ns' . $i] = $credentials[$pdnsKey];
1132+
}
10531133
}
10541134
if ($providerDisplay === 'ClouDNS') {
10551135
$recordData['cloudns_auth_id'] = $cloudnsAuthId;
@@ -1279,6 +1359,26 @@ public function zoneUpdateRecord(Request $request, Response $response)
12791359
}
12801360
if ($powerdnsip !== '127.0.0.1' && isValidIP($powerdnsip)) {
12811361
$deleteData['powerdnsip'] = $powerdnsip;
1362+
$deleteData['pdns_master_ip'] = $powerdnsip;
1363+
}
1364+
// NS2–NS13 (slaves)
1365+
for ($i = 2; $i <= 13; $i++) {
1366+
$suffix = '_NS' . $i;
1367+
1368+
$apiKeyKey = 'API_KEY' . $suffix;
1369+
if (!empty($credentials[$apiKeyKey])) {
1370+
$deleteData['apikey_ns' . $i] = $credentials[$apiKeyKey];
1371+
}
1372+
1373+
$bindKey = 'BIND_IP' . $suffix;
1374+
if (!empty($credentials[$bindKey]) && isValidIP($credentials[$bindKey])) {
1375+
$deleteData['bindip_ns' . $i] = $credentials[$bindKey];
1376+
}
1377+
1378+
$pdnsKey = 'POWERDNS_IP' . $suffix;
1379+
if (!empty($credentials[$pdnsKey]) && isValidIP($credentials[$pdnsKey])) {
1380+
$deleteData['powerdnsip_ns' . $i] = $credentials[$pdnsKey];
1381+
}
12821382
}
12831383
if ($providerDisplay === 'ClouDNS') {
12841384
$deleteData['cloudns_auth_id'] = $cloudnsAuthId;
@@ -1310,6 +1410,26 @@ public function zoneUpdateRecord(Request $request, Response $response)
13101410
}
13111411
if ($powerdnsip !== '127.0.0.1' && isValidIP($powerdnsip)) {
13121412
$updateData['powerdnsip'] = $powerdnsip;
1413+
$updateData['pdns_master_ip'] = $powerdnsip;
1414+
}
1415+
// NS2–NS13 (slaves)
1416+
for ($i = 2; $i <= 13; $i++) {
1417+
$suffix = '_NS' . $i;
1418+
1419+
$apiKeyKey = 'API_KEY' . $suffix;
1420+
if (!empty($credentials[$apiKeyKey])) {
1421+
$updateData['apikey_ns' . $i] = $credentials[$apiKeyKey];
1422+
}
1423+
1424+
$bindKey = 'BIND_IP' . $suffix;
1425+
if (!empty($credentials[$bindKey]) && isValidIP($credentials[$bindKey])) {
1426+
$updateData['bindip_ns' . $i] = $credentials[$bindKey];
1427+
}
1428+
1429+
$pdnsKey = 'POWERDNS_IP' . $suffix;
1430+
if (!empty($credentials[$pdnsKey]) && isValidIP($credentials[$pdnsKey])) {
1431+
$updateData['powerdnsip_ns' . $i] = $credentials[$pdnsKey];
1432+
}
13131433
}
13141434
if ($providerDisplay === 'ClouDNS') {
13151435
$updateData['cloudns_auth_id'] = $cloudnsAuthId;
@@ -1439,6 +1559,26 @@ public function deleteZone(Request $request, Response $response, $args)
14391559
}
14401560
if ($powerdnsip !== '127.0.0.1' && isValidIP($powerdnsip)) {
14411561
$config['powerdnsip'] = $powerdnsip;
1562+
$config['pdns_master_ip'] = $powerdnsip;
1563+
}
1564+
// NS2–NS13 (slaves)
1565+
for ($i = 2; $i <= 13; $i++) {
1566+
$suffix = '_NS' . $i;
1567+
1568+
$apiKeyKey = 'API_KEY' . $suffix;
1569+
if (!empty($credentials[$apiKeyKey])) {
1570+
$config['apikey_ns' . $i] = $credentials[$apiKeyKey];
1571+
}
1572+
1573+
$bindKey = 'BIND_IP' . $suffix;
1574+
if (!empty($credentials[$bindKey]) && isValidIP($credentials[$bindKey])) {
1575+
$config['bindip_ns' . $i] = $credentials[$bindKey];
1576+
}
1577+
1578+
$pdnsKey = 'POWERDNS_IP' . $suffix;
1579+
if (!empty($credentials[$pdnsKey]) && isValidIP($credentials[$pdnsKey])) {
1580+
$config['powerdnsip_ns' . $i] = $credentials[$pdnsKey];
1581+
}
14421582
}
14431583
if ($providerDisplay === 'ClouDNS') {
14441584
$config['cloudns_auth_id'] = $cloudnsAuthId;

0 commit comments

Comments
 (0)