Author Topic: self hosted DNS with one IP - CWP scripting the settings of named.conf  (Read 552 times)

0 Members and 1 Guest are viewing this topic.

Offline
****
Following http://wiki.centos-webpanel.com/how-to-setup-name-servers for one IP settings
Quote
If 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
Quote
zone "" {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


« Last Edit: February 06, 2018, 11:09:21 AM by n8v8r »

Offline
****
Re: self hosted DNS with one IP - CWP scripting the settings of named.conf
« Reply #1 on: February 06, 2018, 01:34:54 PM »
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
Quote
If you are using one IP then it should looks like:
ns1.demo.com --> 185.4.149.83
ns2.demo.com --> 185.4.149.83

Offline
***
Re: self hosted DNS with one IP - CWP scripting the settings of named.conf
« Reply #2 on: February 06, 2018, 05:28:23 PM »
Just a typo :)

Offline
****
Re: self hosted DNS with one IP - CWP scripting the settings of named.conf
« Reply #3 on: February 06, 2018, 05:32:57 PM »
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