• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

Command line - updating DNS-Records: Apply DNS Template Changes?

SchorschB

New Pleskian
Hi @all,

first of all, sorry for my bad english...

I've build my own DDNS-Service and after upgrading Plesk from version 11.5.30 to 12.0.18, Plesk says after DNS changes:
Warning: The DNS zone was modified. If you would like to apply DNS template changes to this zone, either click the 'Apply DNS Template Changes' button on this page or choose the 'Apply the changes to all zones' option in Server Administration Panel > Tools & Settings > DNS Template Settings > Apply DNS Template Changes.

Plesk also updates the timestamp on all records (at the same zone) in "dns_recs".

The script:
- /usr/local/psa/bin/dns --del geosweb.de -a __SUBDOMAIN__ -ip __OLD_IP__
- /usr/local/psa/bin/dns --add geosweb.de -a __SUBDOMAIN__ -ip __NEW_IP__

An "dns --del..." followed by an "dns --add..." works fine and fast (Nameserver update), but an update on the MySQL-Table followed by "dnsmng --update" takes a long time, until the nameserver be updated.

My question(s):
How can I perform a "Apply DNS Template Changes" by command line? Or what is the right way in Plesk, to update the IP on a A-Record?


Many thanks, besten Dank!
Schorsch
 
How can I perform a "Apply DNS Template Changes" by command line? Or what is the right way in Plesk, to update the IP on a A-Record?
Look at /usr/local/psa/bin/dns command with -res and -ip options. Use --help option for more detail.
 
Thank you IgorG. I tried this command and I have a problem.

My domains under a subscription.

subscriptiondomain.com
-> test2.com
-> test3.com

For test2.com or test3.com I add CNAME/A records via CLI. -> /usr/local/psa/bin/dns --add "test2.com" -cname sample -canonical "test2.com"

Now I run this command for applying DNS changes -> /usr/local/psa/bin/dns --reset test2.com -ip XXX.XXX.XXX.XXX

But deleting my custom records.

For every domains I add different custom records via CLI.

How can I resolve this issue?
 
Well, how can I apply custom dns records via cli?
With the same utility and options --add and:

-a '' or <subdomain-name> A resource record
-aaaa '' or <subdomain-name> AAAA resource record
-ns '' or <subdomain-name> NS resource record
-mx '' or <subdomain-name> MX resource record
-cname '' or <subdomain-name> CNAME resource record
-ptr '' or <subdomain-name> PTR resource record
-txt '' or <text> TXT resource record
-ip <ip> Specifies IP address for creating A
record or restoring the default
domain's DNS zone
 
I see following message in domain DNS settings page:

"Warning: The DNS zone was modified. If you would like to apply changes in the DNS template to this zone, either click the 'Apply DNS Template Changes' button on this page or go to the Server Administration Panel > Tools & Settings > DNS Template Settings > Apply DNS Template Changes and choose the 'Apply the changes to all zones' option."

But, working. Thank you IgorG.
 
Back
Top