Applicable to:
- Plesk for Windows
Question
How to update all DNS records for multiple domains at once?
Answer
Click on a section to expand
-
Connect to the server via RDP.
-
Prepare the list of the domains. For example, in order to put all the domains on the server into the
C:\domains.txt
file, use the following Command Prompt command:C:\> "%plesk_bin%\dbclient.exe" --direct-sql --sql="SELECT name FROM domains" > C:\domains.txt
-
Remove the existing A records from the domains:
C:\> for /f "skip=1" %i in (C:\domains.txt); do ("%plesk_cli%\dns.exe" -d %i -a "" -ip 203.0.113.2)
-
Run the following command to add the new A records for the domains:
C:\> for /f "skip=1" %i in (C:\domains.txt); do ("%plesk_cli%\dns.exe" -a %i -a "" -ip 203.0.113.2).
-
Connect to the server via RDP.
-
Prepare the list of the domains. For example, in order to put all the domains on the server into the C:\domains.txt file, use the following Command Prompt command:
C:\> "%plesk_bin%\dbclient.exe" --direct-sql --sql="SELECT name FROM domains" > C:\domains.txt
-
Remove all records for all domains:
C:\>for /f "skip=1" %i in (C:\domains.txt); do ("%plesk_cli%\dns.exe" --del-all %i)
-
Run the following command to add all records for all domains specified in "":
C:\>for /f "skip=1" %i in (C:\domains.txt); do ("%plesk_cli%\dns.exe" -s %i -list "A,example.com,203.0.113.2;MX,mail3,mail.example.com,15;NS,ns2,ns.example.com").
Comments
2 comments
That's however only for those who use windows for PLESK..
@turgut kalfaoglu
Yes, this KB article is only for Windows because Plesk for Windows does not have "DNS Template" feature that has Plesk for Linux. Thus please follow this KB article to update all DNS records in case you have Plesk on Linux server: https://support.plesk.com/hc/en-us/articles/12377584528535
Please sign in to leave a comment.