CPANEL/WHM: How to bulk add DNS zones on the command line

I had about 30 domains I need to create basic zone files for and did not want to do it by hand. I found that you could do the following via the command line:


for i in `cat /root/domainlist`; do /scripts/adddns --domain $i --ip xxx.xxx.xxx.xxx; done;

/root/domainlist is a file that contains a domain on each line without the www. and of course replace xxx.xxx.xxx.xxx with the real ip address:

domain1.com
domain2.com
domain3.com

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter

Leave a Reply