How to switch all custom DNS records to domain IP address after migration.

Created:

2016-11-16 13:17:46 UTC

Modified:

2017-08-16 17:28:36 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to switch all custom DNS records to domain IP address after migration.

Applicable to:

  • Plesk 11.x for Windows
  • Plesk 12.0 for Windows

Symptoms

Source Plesk server uses external SQL server. Destination Plesk server uses local SQL server. Custom DNS records of SQL server are not changed after migration.

Cause

Only domain IP address in DNS zone is replaced with new domain IP address after migration.

Resolution

Mysql query on psa database can be used to change DNSrecords. Then dnsmng.exe utility will update DNS zones.

For example, we need to switch all records named as " sql. " and pointing to IP address 10.10.10.10 or 10.20.20.20 replacing them with domain IP address.

Mysql query for psa database:

update dns_recs r, domains d, dom_param p, dns_zone z, ip_addresses ipset r.val=ip.ip_address,r.displayval=ip.ip_addresswhere r.val in ('10.10.10.10','10.20.20.20')and r.host like '%sql.%'and r.type='A'and r.dns_zone_id=z.id and d.dns_zone_id=z.idand d.id=p.dom_idand p.param='ip_addr_id'and p.val=ip.id;

This query replaces all 'A' records named as sql. , having IP addresses 10.10.10.10 or 20.20.20.20, with domain IP address.

Synchronize DNS server whith records in ' psa ' DB:

%plesk_bin%\\DNSMng.exe update *
Have more questions? Submit a request
Please sign in to leave a comment.