• Article for your preferred language does not exist. Below is international version of the article.

Article ID: 118999, created on Dec 4, 2013, last review on Oct 4, 2016

  • Applies to:
  • Plesk Automation 11.1
  • Plesk Automation 11.5

Symptoms

For a DNS zone in Plesk Automation (PA), there is the option Switch DNS Hosting to External/Switch DNS Hosting to Internal. This action needs to be automated for several domains.

Resolution

To switch DNS Hosting to external and back for all DNS zones, you should perform the following steps on the Management Node:

  1. Create a list of the relevant domain IDs and subscription IDs using the following command:

     psql -h`hostname` -Uplesk plesk --no-align --field-separator ' ' -t -c "select d.domain_id, s.sub_id from domains d left join subs_resources s on d.hosting_res=s.rt_instance_id where s.sub_id is not null;" > sub_id 
    
  2. Create XML files to use in API requests (pem.removeDNSHosting.xml and pem.addDNSHosting.xml):

    pem.removeDNSHosting.xml

    <methodCall>
    <methodName>pem.removeDNSHosting</methodName>
    <params>
    <param>
    <value>
    <struct>
    <member>
    <name>domain_id</name>
    <value>
    <int>abc</int>
    </value>
    </member>
    </struct>
    </value>
    </param>
    </params>
    </methodCall>
    

    pem.addDNSHosting.xml

    <methodCall>
    <methodName>pem.addDNSHosting</methodName>
    <params>
    <param>
    <value>
    <struct>
    <member>
    <name>domain_id</name>
    <value>
    <int>abc</int>
    </value>
    </member>
    <member>
    <name>subscription_id</name>
    <value>
    <int>qaz</int>
    </value>
    </member>
    </struct>
    </value>
    </param>
    </params>
    </methodCall>
    
  3. Change the DNS service to external for all domains using the following API request, where abc is a placeholder of the domain ID value :

    cat sub_id | while read i z; do cat pem.removeDNSHosting.xml | sed 's/abc/'$i'/g' | curl -k -uadmin:<PASSWORD> -d@- 'https://<IP_ADDRESS>:8440/RPC2'; done
    

    where:

    PASSWORD - The PA administrator's password.

    IP_ADDRESS - The IP address of the PA management node.

  4. Change the DNS service to internal for all domains using the following API request, where 'abc' is the domain_id and 'qaz' is subscription_id:

    cat sub_id | while read i z; do cat pem.addDNSHosting.xml | sed 's/abc/'$i'/g' | sed 's/qaz/'$z'/g' | curl -k -uadmin:<PASSWORD> -d@- 'https://<IP_ADDRESS>:8440/RPC2'; done
    

Search Words

520 ip and spf record not match (in reply to MAIL FROM command)

Replace node with new hardware

Bind DNS query refused

PPA Migrator Nameserver Record Duplication

Name server changed IP. It cant be updated on PPA because record is already in use

named death

nameserver invalid

DNS fatal error

ressource soa records ttl apply

slave dns not being synced with the primary dns

Sender Framework Policy (SPF) Records

no dns response (refused)

Change of IP Address of Mail Service node causes faulty mx records

DNS nose change IP address

c1ecc6010feff26cb42d1d14a7881dd6 e0aff7830fa22f92062ee4db78133079 33a70544d00d562bbc5b17762c4ed2b3 caea8340e2d186a540518d08602aa065

Email subscription for changes to this article
Save as PDF