stefanpejcic / OpenPanel

OpenPanel is a powerful and flexible web hosting control panel for Linux systems.
https://openpanel.com
MIT License
86 stars 17 forks source link

Nameservers change should edit existing dns zones also! #80

Open stefanpejcic opened 4 months ago

stefanpejcic commented 4 months ago

OpenPanel version(s) affected

0.1.6

Description

Wehn new nameservers are set we should also edit all existing dns zones for domains.

How to reproduce

add ns add domain change ns check dns zone for domain

Possible Solution

sed the dns zone files

$TTL 1h
@       IN      SOA     ns1.sss.rs. ns2.sss.rs. (
                        23         ; Serial number
                        1h              ; Refresh interval
                        15m             ; Retry interval
                        1w              ; Expire interval
                        1h )            ; Minimum TTL

@ IN NS      ns1.sss.rs.
@ IN NS      ns2.sss.rs.

Additional Context

No response

stefanpejcic commented 2 months ago

This is a rare case, no serious provider will change ns im production for hundreds of domains..

Should maybe host sed on initial ns setting:

https://github.com/stefanpejcic/openpanel-docker-cli/blob/main/domains/update_ns.shTODO