self hosted DNS with one IP - CWP scripting the settings of named.conf

Started by n8v8r, February 06, 2018, 11:07:44 AM

Previous topic - Next topic

n8v8r

Following http://wiki.centos-webpanel.com/how-to-setup-name-servers for one IP settings
QuoteIf you are using one IP then it should looks like:
ns1.demo.com --> 185.4.149.83
ns1.demo.com --> 185.4.149.83
In such case CWP (Edit Nameservers) is scripting the settings of named.conf zone with
Quote"zone ns1.demo.com" {type master;file "/var/named/ns1.demo.com.db";};
zone "ns1.demo.com" {type master;file "/var/named/ns1.demo.com.db";};
Which is a duplication named does not accept and complains about
Quote/etc/named.conf:LineN: zone 'ns1.demo.com': already exists previous definition: /etc/named.conf:LineN-1

If the second NS is left empty instead the CWP (Edit Nameservers) is scripting the settings of named.conf zone with
Quotezone "" {type master;file "/var/named/.db";};
which is basically empty and not accepted by named either
Quote/etc/named.conf:LineN: zone '': is not a valid name

Either way named.conf has to be cleaned manually afterwards. The expected behavior of CWP (Edit Nameservers) scripting would be:
- compare the strings of NS1 and NS2 and if a match not duplicate the first in named.conf, or
- if the second NS is left empty not to produce an empty zone in named.conf



n8v8r

Might be just a clerical error in the cited wiki article. If indeed 2 NS entries are mandatory then perhaps for single IP the wiki should read instead
QuoteIf you are using one IP then it should looks like:
ns1.demo.com --> 185.4.149.83
ns2.demo.com --> 185.4.149.83


n8v8r

Sure, but to the uninitiated it could cause quite some headache. Perhaps it should be corrected and added that even with a single IP a parent NS(1) and child NS(2) are mandatory.

And perhaps the input mask in CWP should prevent an empty NS, whether parent or child. Which would help to mitigate errors