1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

how to regenerate all DNS records after DNS template change

Discussion in 'Plesk for Linux - 8.x and Older' started by flupke, Feb 16, 2008.

  1. flupke

    flupke Guest

    0
     
    I changed he DNS template, I now would like PLESK to update all domains accordingly, can't find the way to do it.

    Regards,

    Flupke
     
  2. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    You'll have to make the changes to existing domains yourself. If you're dealing with a lot of domains you probably want to script this or change it in the psa database directly (make backups beforehand!).
     
  3. Monica@

    Monica@ Guest

    0
     
    Try this one (it takes the domain names from the database and update the zone files):
    mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e 'select name from domains' |
    awk '{print "/usr/local/psa/admin/sbin/dnsmng update " $1 }' | sh
     
  4. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    Yes, that one-liner regenerates all zonefiles according to the info in the psa database, but it doesn't re-apply the DNS template to all domains and I believe that is what flupke wants.
     
  5. Spazholio@

    Spazholio@ Guest

    0
     
    I know this thread is sorta old, but I just ran into this while prepping all my domains for a migration. Using the DB Web Admin, issue a command like:

    UPDATE `dns_zone` SET `ttl` = '300', `ttl_unit` = '60' WHERE `id` >1;

    This query will change the TTL on all domains to 5 mins (300 seconds). If you need to change other things, I would recommend altering just one domain, and then looking in the DB to see what values that domain has, and mirroring it in the query. You can do this from command-line too, but I was already in the DB Web Admin when I wrote the query.

    After that, run the command that Monica listed above to regenerate all the zone files.

    Best of luck!
     
Loading...