Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2014
    Posts
    72
    Points
    3,247
    Level
    23

    Question Can't Get CLI To Work Properly

    I'm trying to list all the zones from Siteworx CLI. I also need to add a bunch of A records. Here's the result:

    Code:
    siteworx -u -n -v -c Dns -a records --zone_id 72 -o json  
    iw_action_name : This input is required
    
    In that example I'm trying to list all the records for zone 72. What am I doing wrong? I try -h and it's not giving me any insight. Like I said, I also need to add A records. I have to do this all in non-interactive mode (-n).

  2. #2
    Join Date
    Apr 2012
    Posts
    2,125
    Points
    21,809
    Level
    64
    Hi Synthetisoft
    I hope your well
    I am not sure what your trying to achieve but I hope below helps you a little. You can change master.url to one of your hosted domains to test with and change the --host ww3.master.url to match your test, also chnage IP from 10.0.1.1 to your required
    I hope that helps a little and makes it easier to understand
    Many thanks
    John

    To list zones for domain
    siteworx -u --login_domain=master.url -v -n -c Dns -a listZones
    25 master.url 1 0 master master.url
    27 s-alias.url 1 0 pointer master.url
    Command executed: siteworx -u --login_domain [DOMAIN] -n -c Dns -a listZones
    To add A record to a zone
    siteworx -u --login_domain=master.url -v -n -c Dns -a addA --host ww3.master.url --ipaddress 10.0.1.1 --zone_id 25
    Attached Images Attached Images  

  3. #3
    Join Date
    Mar 2014
    Posts
    72
    Points
    3,247
    Level
    23
    Quote Originally Posted by d2d4j View Post
    Hi Synthetisoft
    I hope your well
    I am not sure what your trying to achieve but I hope below helps you a little. You can change master.url to one of your hosted domains to test with and change the --host ww3.master.url to match your test, also chnage IP from 10.0.1.1 to your required
    I hope that helps a little and makes it easier to understand
    Many thanks
    John

    To list zones for domain
    siteworx -u --login_domain=master.url -v -n -c Dns -a listZones
    25 master.url 1 0 master master.url
    27 s-alias.url 1 0 pointer master.url
    Command executed: siteworx -u --login_domain [DOMAIN] -n -c Dns -a listZones
    To add A record to a zone
    siteworx -u --login_domain=master.url -v -n -c Dns -a addA --host ww3.master.url --ipaddress 10.0.1.1 --zone_id 25
    Thanks for that. I'm also trying to list the records in a zone.

  4. #4
    Join Date
    Apr 2012
    Posts
    2,125
    Points
    21,809
    Level
    64
    Hi Synthetisoft
    Ah sorry, please try this but change as needed. The y at the end is yes for save or n for no save, but if no save will abort
    Many thanks
    John
    siteworx -u --login_domain=master.url -v -n -c Dns -a queryDnsRecords --zone_id 25 y
    My test result
    309 25 master.url A ipv4.master.url {ipv4} 43200
    310 25 master.url A mail.master.url {ipv4} 43200
    311 25 master.url A master.url {ipv4} 43200
    383 25 master.url A ww2.master.url 10.0.1.1 43200
    384 25 master.url A ww3.master.url 10.0.1.1 43200
    312 25 master.url CNAME ftp.master.url master.url 43200
    313 25 master.url CNAME www.master.url master.url 43200
    316 25 master.url MX master.url 10 mail.master.url 43200

    Command executed: siteworx -u --login_domain [DOMAIN] -n -c Dns -a queryDnsRecords --zone_id 25

  5. #5
    Join Date
    Mar 2014
    Posts
    72
    Points
    3,247
    Level
    23
    Quote Originally Posted by d2d4j View Post
    Hi Synthetisoft
    Ah sorry, please try this but change as needed. The y at the end is yes for save or n for no save, but if no save will abort
    Many thanks
    John
    siteworx -u --login_domain=master.url -v -n -c Dns -a queryDnsRecords --zone_id 25 y
    My test result
    309 25 master.url A ipv4.master.url {ipv4} 43200
    310 25 master.url A mail.master.url {ipv4} 43200
    311 25 master.url A master.url {ipv4} 43200
    383 25 master.url A ww2.master.url 10.0.1.1 43200
    384 25 master.url A ww3.master.url 10.0.1.1 43200
    312 25 master.url CNAME ftp.master.url master.url 43200
    313 25 master.url CNAME www.master.url master.url 43200
    316 25 master.url MX master.url 10 mail.master.url 43200

    Command executed: siteworx -u --login_domain [DOMAIN] -n -c Dns -a queryDnsRecords --zone_id 25
    Thanks. What is it saving if it's just listing them? I'm also trying to delete a record like this:

    siteworx -u --login_domain=site.com -v -
    n -c Dns -a delete --host sub.site.com --zone_id 72 --rec
    ord_id=2399

    But it says I need to paas "confirm_action"
    Last edited by Synthetisoft; 06-22-2017 at 08:01 AM.

  6. #6
    Join Date
    Apr 2012
    Posts
    2,125
    Points
    21,809
    Level
    64
    Hi Synthetisoft
    Many thanks and I hope your well
    Please have a look at my CLI, as your missing --confirm_action 1 y and it should work lovely as my test below shows
    I hope that helps a little
    Many thanks
    John
    siteworx -u --login_domain=master.url -v -n -c Dns -a delete --record_id 412 --confirm_action 1 y
    CLI changes made
    siteworx -u --login_domain=master.url -v -n -c Dns -a addA --host ww8.master.url --ipaddress 10.0.1.1 --zone_id 25

    DNS 'A' record successfully added
    Command executed: siteworx -u --login_domain [DOMAIN] -n -c Dns -a addA --host ww8.master.url --ipaddress 10.0.1.1 --zone_id 25

    Complete
    siteworx -u --login_domain=master.url -v -n -c Dns -a queryDnsRecords --zone_id 25 y
    309 25 master.url A ipv4.master.url {ipv4} 43200
    310 25 master.url A mail.master.url {ipv4} 43200
    311 25 master.url A master.url {ipv4} 43200
    383 25 master.url A ww2.master.url 10.0.1.1 43200
    412 25 master.url A ww8.master.url 10.0.1.1 43200
    312 25 master.url CNAME ftp.master.url master.url 43200
    313 25 master.url CNAME www.master.url master.url 43200
    316 25 master.url MX master.url 10 mail.master.url 43200

    Command executed: siteworx -u --login_domain [DOMAIN] -n -c Dns -a queryDnsRecords --zone_id 25

    Complete
    siteworx -u --login_domain=master.url -v -n -c Dns -a delete --record_id 412 --confirm_action 1 y

    DNS record successfully deleted
    Command executed: siteworx -u --login_domain [DOMAIN] -n -c Dns -a delete --confirm_action all --record_id 412

    Complete
    siteworx -u --login_domain=master.url -v -n -c Dns -a queryDnsRecords --zone_id 25 y
    309 25 master.url A ipv4.master.url {ipv4} 43200
    310 25 master.url A mail.master.url {ipv4} 43200
    311 25 master.url A master.url {ipv4} 43200
    383 25 master.url A ww2.master.url 10.0.1.1 43200
    312 25 master.url CNAME ftp.master.url master.url 43200
    313 25 master.url CNAME www.master.url master.url 43200
    316 25 master.url MX master.url 10 mail.master.url 43200

    Command executed: siteworx -u --login_domain [DOMAIN] -n -c Dns -a queryDnsRecords --zone_id 25

    Complete

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •