creating zones, records and websites using the remoting api

Discussion in 'ISPConfig 3 Priority Support' started by saco721, Aug 1, 2016.

  1. saco721

    saco721 Member

    I have multiserver setup on debian squeeze with ispconfig 3.0.5.4p8.
    I have found a very good script that accomplishes what I need to do, which is basically create a dns zone and website using the remoting api, but i'm having problems. Basically the DNS zone is being created, but the a record, ns records and mx records are still missing. The site is also being created. If I try to access the site I get :

    But if I delete the newly created client I get :
    I have checked the dns_rr table and 9 records exist for the zone that the script created, but when I try to view the records in ispconfig, they do not appear.
    I have attached the script and hope that someone can help me identify where the problem is. Thank you for your help.
     

    Attached Files:

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Most likely your script sets some parameters wrong. Compare a record that this script created in the database (dns_* tables) with one that you created within ispconfig to see the differences.
     
  3. saco721

    saco721 Member

    Hi,
    I have managed to get the script to create the client, zones, records and website in ISPConfig but I get the following message when trying to connect to the site :

    I have checked the script parameters against records added from ISPConfig and they appear to be the same, what else can I try?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Has the zonefile been created in the named directory and is is saved without .err ending? You can also use the ispconfig debug mode to see what happens in detail on the server and if a zone gets rejected due to errors.
     
  5. saco721

    saco721 Member

    Hi Till,
    I have checked the zone file and it has been saved with a .err ending. I have got the following warning while debugging the script :

    Here is the pri.testing.domain.com.err file :
    How do I correct this problem?
     
  6. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Add a dot at the end of ??.domain.com. I.e. testing.domain.com.
     
  7. saco721

    saco721 Member

    Hi Florian030,

    I have tried concatenating a period at the end of the hostdomain variable in the example script using :

    To get the dot at the end of testing.domain.com and I get :
     
  8. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Your submitted domain is wrong. Maybe you can post your script?
     
  9. saco721

    saco721 Member

    Hi,
    Here is the script.
    Thanks for your help.
     

    Attached Files:

  10. saco721

    saco721 Member

    Hi Florian,
    As you suggested I added a period at the end of the hostname in ISPConfig records after running the script and the zone file that had an err ending is now fine. However I cannot get this to work in the script. How do I get a period at the end of 'name' => $hostdomain,
    ie $hostdomain.".";
    without getting the
    error
    Is there a function in the remoting api that creates the dns records automatically after creating the zone like add new dns zone with wizard?
    Thanks for your time!
     
    Last edited: Jan 19, 2017
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Adding a dot to the domain and then pass it to the api should work. May you please post the full new script that you use now.

    No.
     
  12. saco721

    saco721 Member

    Hi Till,

    Here is the script that I have at the moment:
     

    Attached Files:

  13. till

    till Super Moderator Staff Member ISPConfig Developer

    You get the error "domain_error_regex" because the domain in the variable $hostdomain is incorrect while adding the website (not the dns). So you must check that this value is a correctly formatted domain name like "domain.tld" or "sub.domain.tld".

    Late in the script, you use the same variable to create the dns zone, but in dns, a domain must end with a dot.
    sou you have to append a dot to the domain name when adding the dns zone.
     
    Jesse Norell likes this.
  14. saco721

    saco721 Member

    Hi Till,
    Problem solved, thank you very much for your help:)
     

Share This Page