Search Engine: Elastic

Article ID: 124158, created on Jan 7, 2015, last review on Jun 4, 2018

  • Applies to:
  • Operations Automation 7.0
  • Operations Automation 7.3
  • Operations Automation 6.0
  • Operations Automation 5.5
  • Operations Automation 5.4
  • Business Automation 7.2
  • Business Automation 5.5

Question

You have added a new nameserver to OA. It is automatically used for new domains that are added to OA. But for existing domains it is not. How to update existing POA domains to use this new nameserver?

Answer

Change DNS hosting for existing domains from Internal to External and then back from External to Internal:

  1. OA Provider CP Top > Services > Domains > customer1.com > DNS > Click Change DNS Hosting to External > Submit.

  2. OA Provider CP Top > Services > Domains > customer1.com > DNS > Click Change DNS Hosting to Internal > Choose correct DNS hosting assigned to the domain > Submit

Another way to do the same would be through the following API method pem.syncNameServers:

<?xml version="1.0"?>
<methodCall>
  <methodName>pem.syncNameServers</methodName>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>domain_name</name>
            <value>
              <string>DOMAIN_NAME</string>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>

The following script will help to do that in automated way

NOTE: Replace FQDN with your OA database host name (OR) IP Address.

#!/bin/bash
# Script to Transfer Existing Zone files to Newly Deployed Name Servers

# Get the list of domains hosted in OA
psql -U plesk -d plesk  -h<FQDN> -c "SELECT name FROM domains" > domain.list

# Remove the Headers
H2=`head -2 domain.list`

# Filter Spaces and Unwanted strings
egrep -v "$H2|[0-9]*rows|^$" domain.list > domain_final.list

# Sync the zone files to newly deployed name servers.
for i in `cat domain_final.list`
do
    cp -av pem.syncNameServers.xml pem.syncNameServers_act.xml;
    sed -i 's/DOMAIN_NAME/'$i'/' pem.syncNameServers_act.xml;
    curl -d@pem.syncNameServers_act.xml http://localhost:8440/RPC2 >> /var/log/pem_syncNameServers.log 2>> /var/log/pem_syncNameServers_error.log;
    rm -vf pem.syncNameServers_act.xml;
    sleep 10;
done

ac82ce33439a9c1feec4ff4f2f638899 caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 5356b422f65bdad1c3e9edca5d74a1ae 2554725ed606193dd9bbce21365bed4e 5b048d9bddf8048a00aba7e0bdadef37 956c448bddc7e1f3585373687602379f 6f1456866eed87488c0f02b298a741c0 dd79f16c76b9dca75205ab5e9f5465ea 1941880841f714e458ae4dc3d9f3062d ef171e3fccb12bd8e09076a7b49212c0 198398b282069eaf2d94a6af87dcb3ff b2c3b33425dfc50c7d41a2efaa7f84f3 0871c0b47b3b86ae3b1af4c2942cd0ce 801221f8cd76fba7300d1e6817c8e08b 92711db0799e8aefe8e51f12dace0496

Email subscription for changes to this article
Save as PDF