• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue transfer dns zones to slave

weelow

Basic Pleskian
From what i understand that dns slave manager on plesk will automatically create, modify and update any dns zone. The problem is that we have a server with existing domains before setting up the slave.

How do we transfer the existing zones from the master to slave without having to create entries one by one?
Also if a zone on the master gets deleted will it also delete the zone on the slave? if not how can we automate this process also?
 
weelow,

You can use an extension for Amazon AWS Route53 https://www.plesk.com/extensions/amazon-route53/ . You will have four DNS slaves. "Sync All Zones", see screenshot #3.

Or another an extension https://www.plesk.com/extensions/slave-dns-manager/ if you want to use your own server. I don't remember here options like "mass domains management" but I think it will be possible to do by script :)

Github:
- https://github.com/plesk/ext-route53
- https://github.com/plesk/ext-slave-dns-manager


I am now using ext-slave-dns-manager but i want to transfer existing domains from master to the slave. how can i do that properly with a tested method/script?

something like this maybe
https://matoski.com/article/bind-slave-dns-automatic-additions-of-zones/
or
https://github.com/getchudez/plesk-scripts/blob/master/gen-dns-slave.sh
 
Its driving me crazy. This is what i am getting on the slave server.
service named status -l

also note that owner is named:named of directory and files and all files are chmod 777
ports are open and i can telnet from the master server

Mar 09 08:54:22 NS1 named[6921]: received control channel command 'addzone example.com { type slave; file "/var/named/chroot/var/example.com"; masters { 10.0.0.15; }; };'
Mar 09 08:54:22 NS1 named[6921]: zone example.com added to view _default via addzone
Mar 09 08:54:22 NS1 named[6921]: zone example.com/IN: Transfer started.
Mar 09 08:54:22 NS1 named[6921]: transfer of 'example.com/IN' from 10.0.0.15#53: connected using 10.0.0.201#58739
Mar 09 08:54:23 NS1 named[6921]: transfer of 'example.com/IN' from 10.0.0.15#53: failed while receiving responses: NXDOMAIN
Mar 09 08:54:23 NS1 named[6921]: transfer of 'example.com/IN' from 10.0.0.15#53: Transfer completed: 0 messages, 0 records, 0 bytes, 0.217 secs (0 bytes/sec)

any suggestions why i am gettings this, could it be because it is trying to connect on port 58739 which may not be open by the firewall? if so, how do i force it to use specific ports?

This is the command i used on the master server
/usr/sbin/rndc -c /usr/local/psa/var/modules/slave-dns-manager/slave_10.0.0.201.conf addzone example.com '{ type slave; file "/var/named/chroot/var/example.com"; masters { 10.0.0.15; }; };'

Appreciate all the help
 
Last edited:
Is zone "example.com" configured at 10.0.0.15? There is an answer from 10.0.0.15: NXDOMAIN = Non-Existent Domain.
 
Is zone "example.com" configured at 10.0.0.15? There is an answer from 10.0.0.15: NXDOMAIN = Non-Existent Domain.

yes zone example.com is configured on 10.0.0.15
maybe it is showing that because it tried to connect to a port blocked by the firewall?

Mar 09 08:54:22 NS1 named[6921]: transfer of 'example.com/IN' from 10.0.0.15#53: connected using 10.0.0.201#58739

why is it connecting to port 58739 for the transfer? why not the normal port 53?
 
It connects from 10.0.0.201#58739 to 10.0.0.15#53, it's normal. What's show command (from 10.0.0.201 and from 10.0.0.15): dig @10.0.0.15 example.com

As an example for non-existent domain:

# dig @8.8.8.8 foobar.foobar.com | grep NXDOMAIN
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 48431
 
It connects from 10.0.0.201#58739 to 10.0.0.15#53, it's normal. What's show command (from 10.0.0.201 and from 10.0.0.15): dig @10.0.0.15 example.com

As an example for non-existent domain:

# dig @8.8.8.8 foobar.foobar.com | grep NXDOMAIN
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 48431

From the slave terminal:
[root@slave]# dig @10.0.0.15 example.com

; <<>> DiG 9.9.4-RedHat-9.9.4-38.el7_3.2 <<>> @10.0.0.15 example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16696
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;example.com. IN A

;; ANSWER SECTION:
example.com. 86400 IN A 43.89.21.258

;; AUTHORITY SECTION:
example.com. 86400 IN NS ns2.example.com.
example.com. 86400 IN NS ns1.example.com.

;; ADDITIONAL SECTION:
ns2.example.com. 86400 IN A 43.89.21.258
ns1.example.com. 86400 IN A 43.89.21.259

;; Query time: 3 msec
;; SERVER: 10.0.0.15#53(10.0.0.15)
;; WHEN: Thu Mar 09 16:33:35 UTC 2017
;; MSG SIZE rcvd: 126

From the master terminal:
[root@master]# dig @10.0.0.201 example.com

; <<>> DiG 9.9.4-RedHat-9.9.4-38.el7_3.2 <<>> @10.0.0.201 example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 65391
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;example.com. IN A

;; Query time: 3 msec
;; SERVER: 10.0.0.201#53(10.0.0.201)
;; WHEN: Thu Mar 09 18:39:28 EET 2017
;; MSG SIZE rcvd: 42
 
Mar 09 08:54:22 NS1 named[6921]: received control channel command 'addzone example.com { type slave; file "/var/named/chroot/var/example.com"; masters { 10.0.0.15; }; };'
Who is who here? Is it log from NS1? Is it slave? Here is insufficient info, needs more deeper look into logs and configs.
 
Last edited:
Who is who here? Is it log from NS1? Is it slave? Here is insufficient info, needs more deeper look into logs and configs.
NS1 is the slave

slave named log file
transfer of 'emaple.it/IN' from 53.81.34.118#53: connected using 10.0.0.201#60764
transfer of 'emaple.it/IN' from 53.81.34.118#53: failed while receiving responses: NXDOMAIN
transfer of 'emaple.it/IN' from 53.81.34.118#53: Transfer completed: 0 messages, 0 records, 0 bytes, 0.164 secs (0 bytes/sec)
zone example2.com/IN: Transfer started.
transfer of 'example2.com/IN' from 53.81.34.118#53: connected using 10.0.0.201#36385
transfer of 'example2.com/IN' from 53.81.34.118#53: failed while receiving responses: NXDOMAIN

I have disabled firewall and getting the same problem.
The domains exist on the 53.81.34.118 and they resolve normally with nslookup as follows:

[root@NS1]# dig @53.81.34.118 greens247.com

; <<>> DiG 9.9.4-RedHat-9.9.4-38.el7_3.2 <<>> @53.81.34.118 example2.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5906
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;example2.com. IN A

;; ANSWER SECTION:
example2.com. 86400 IN A 53.81.34.118

;; AUTHORITY SECTION:
example2.com. 86400 IN NS ns2.example2.com.
example2.com. 86400 IN NS ns100.example2.com.

;; ADDITIONAL SECTION:
ns100.example2.com. 86400 IN A 53.81.34.119
ns2.example2.com. 86400 IN A 53.81.34.118

;; Query time: 4 msec
;; SERVER: 53.81.34.118#53(53.81.34.118)
;; WHEN: Fri Mar 10 18:22:34 UTC 2017
;; MSG SIZE rcvd: 128

On the master servers:
rndc -c /usr/local/psa/var/modules/slave-dns-manager/slave_10.0.0.201.conf addzone example2.com '{ type slave; file "example2.com"; masters { 53.81.34.118; }; };'
rndc: 'addzone' failed: already exists

no error in log files when transfer happens. firewall disabled on both slave and master

when I used rndc addzone command a file 3bf305731dd26307.nzf was created on the slave. the path for each domain zone file is in "domainname.com" but there is no files like that in the location, i guess because they were not transferred. I tried to change the location to "/var/named/example2.com" and mannually created the zone file for that domain. and restarted named service but still it wont resolve the domain locally nor allow me to query that domain from another computer.
I tired to allow recursion by removing recursion no; and tried the following command from windows computer
nslookup google.com the slaveserver.com
and it worked how ever when i try it with the domain i manually copied example2.com it gives me this error

*** UnKnown can't find greens247.com: Server failed

I think my problem maybe because the slave and master servers have internal ip addresses and external ip addresses and this may be the reason for the problem, i just dont know how to fix it.
 
Last edited:
Back
Top