Articles in this section

How to bulk update the IP address in multiple DNS A records?

Plesk for Windows kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

How can one update the IP address in multiple Plesk DNS A records at once?

Answer

   
Plesk for Linux
   
  1. Connect to the server via SSH

  2. Back up the Plesk database

    # plesk db dump psa > psa_pre_ip_update_backup_$(date +%F-%T).sql

  3. Use one of these commands to update the records

    Note: In this example, 203.0.113.2 is the current IP address, and 203.0.113.3 is the new one. Replace them with the real ones.

    • For one domain

      # plesk db "UPDATE dns_recs SET val='203.0.113.3', displayVal='203.0.113.3' WHERE host LIKE '%example.com%' and type='A' AND displayVal='203.0.113.2'"

    • For all domains on the server

      # plesk db "UPDATE dns_recs SET val='203.0.113.3', displayVal='203.0.113.3' WHERE type='A' AND displayVal='203.0.113.2'"

  4. Update the DNS configuration files with the repair utility

    # plesk repair dns -y

   
Plesk for Windows
   
  1. Connect to the server via RDP

  2. Start a Command Prompt or PowerShell terminal

  3. Back up the Plesk database

    PS plesk db dump psa > psa_pre_ip_update_backup.sql

  4. Use one of these commands to update the records

    Note: In this example, 203.0.113.2 is the current IP address, and 203.0.113.3 is the new one. Replace them with the real ones.

    • For a specific domain

      PS plesk db "UPDATE dns_recs SET val='203.0.113.3', displayVal='203.0.113.3' WHERE host LIKE '%example.com%' and type='A' AND displayVal='203.0.113.2'"

    • For all domains on the server

      PS plesk db "UPDATE dns_recs SET val='203.0.113.3', displayVal='203.0.113.3' WHERE type='A' AND displayVal='203.0.113.2'"

  5. Update the DNS configuration files with the repair utility

    PS plesk repair dns -y

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.