Issue when creating DNS Zone via API (WHMCS)

Discussion in 'ISPConfig 3 Priority Support' started by cajdavidson, May 1, 2019.

  1. cajdavidson

    cajdavidson New Member HowtoForge Supporter

    Hi,

    We are creating a DNS Zone via the API using the following WHMCS module (https://github.com/cwispy/ispcfg3).

    When creating the zone the data is appearing to be inserted into ISPConfig correctly, and is present in the dbispconfig database under the "dns_rr" table, but the zonefile on the server does not have any records added.

    When going into the zone selecting records we can see them, if we then go back to the other tab we get a message that the zone is not loaded due to having no NS records. If I then go into an individual record and save it, that single record is correctly added to the zone, so it seems like it is just a final confirmation part that is needed.

    If you need any more information or clarification on this, please let me know.

    Cheers,
    Chris.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    When you open each zone record in ISPConfig and save it without having modified it, then the zone is written to disk correctly?
     
  3. cajdavidson

    cajdavidson New Member HowtoForge Supporter

    Yes, that is correct.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

  5. felan

    felan Member HowtoForge Supporter

    WHMCS is only one example, we tried to send a SOAP request to "dns_templatezone_add" following the documentation at
    https://www.howtoforge.com/how-to-create-remote-api-scripts-for-ispconfig-3 and we still reproduce the same issue. For some reason " dns_templatezone_add" is not creating the dns zone file or the sync process is failing in some point. Other tests with site,db,ftp creation have no issues.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

  7. felan

    felan Member HowtoForge Supporter

    Hi Till.

    This is the error we get.

    02.05.2019-11:29 - DEBUG - Replicated from master: REPLACE INTO `dns_soa` (`id`,`sys_userid`,`sys_groupid`,`sys_perm_user`,`sys_perm_group`,`sys_perm_other`,`server_id`,`origin`,`ns`,`mbox`,`serial`,`refresh`,`retry`,`expire`,`minimum`,`ttl`,`active`,`xfer`,`also_notify`,`update_acl`,`dnssec_initialized`,`dnssec_wanted`,`dnssec_last_signed`,`dnssec_info`) VALUES ('155','345','339','riud','ru','','2','limecity.org.','ns1.designrus.dk.','info.limecity.org.','2019050201','1200','540','1209600','3600','3600','Y','138.201.194.78,193.163.102.6,2a01:630:0:40:3:4:5:6',NULL,NULL,'N','N','0',NULL)

    02.05.2019-11:29 - DEBUG - Calling function 'soa_update' from plugin 'bind_plugin' raised by event 'dns_soa_update'.

    02.05.2019-11:29 - DEBUG - Writing BIND domain file failed: /etc/bind/pri.limecity.org zone limecity.org/IN: has no NS records zone limecity.org/IN: not loaded due to errors.

    02.05.2019-11:29 - DEBUG - Reason for Bind restart failure: zone limecity.org/IN: has no NS records

    zone limecity.org/IN: not loaded due to errors.

    02.05.2019-11:29 - DEBUG - Writing BIND named.conf.local file: /etc/bind/named.conf.local

    02.05.2019-11:29 - DEBUG - Processed datalog_id 18866

    02.05.2019-11:29 - DEBUG - Calling function 'restartBind' from module 'dns_module'.

    02.05.2019-11:29 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock

    finished.

    But inside ispconfig, all the data is stored in the database, though we get this message.
    [​IMG]
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so there is no attempt made to write the rr records at all, the ns error is normal when the zone is added as the ns records do not exist at that time. So there might be a problem in the dns template or in the function dns_templatezone_add. The same dns template works flawlessly when you use it to create a new zone within ISPConfig?
     
  9. felan

    felan Member HowtoForge Supporter

    That is correct.

    Here is the file that IS created throught the api. When done normally inside ispconfig, no issues.
    Code:
    [email protected] /etc/bind # cat pri.limecity.org.err
    $TTL        3600
    @       IN      SOA     ns1.designrus.dk. info.limecity.org. (
                            2019050203       ; serial, todays date + todays serial #
                            1200              ; refresh, seconds
                            540              ; retry, seconds
                            1209600              ; expire, seconds
                            3600 )            ; minimum, seconds
    ;
    
     
  10. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    the dns-template from your api-call exists? the client has a default dns-server set?
     
  11. cajdavidson

    cajdavidson New Member HowtoForge Supporter

    Yes we only have 1 dns-template, with the ID of 1 which is being passed as part of the api call.

    Below are the default settings, there seems to only be a "Default Secondary DNS Server", should I be looking elsewhere for a "Default Primary DNS Server"?

    upload_2019-5-2_14-44-36.png
     
  12. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    did you set the NS records in the template?
     
  13. felan

    felan Member HowtoForge Supporter

    The template looks like this:
    Code:
    [ZONE]
    origin={DOMAIN}.
    ns=ns1.designrus.dk.
    mbox={EMAIL}.
    refresh=1200
    retry=540
    expire=1209600
    minimum=3600
    ttl=3600
    xfer=138.201.194.78,193.163.102.6,2a01:630:0:40:3:4:5:6
    
    [DNS_RECORDS]
    A|{DOMAIN}.|{IP}|0|3600
    A|www|{IP}|0|3600
    CNAME|autoconfig|discover.designrus.dk.|3600
    NS|{DOMAIN}.|ns1.designrus.dk.|0|3600
    NS|{DOMAIN}.|ns2.designrus.dk.|0|3600
    MX|{DOMAIN}.|server1.designrus.dk.|10|3600
    TXT|{DOMAIN}.|v=spf1 mx a a:server1.designrus.dk a:server2.designrus.dk a:server3.designrus.dk a:server4.designrus.dk ~all|0|3600
    TXT|_dmarc.{DOMAIN}.|v=DMARC1; p=quarantine; rua=mailto:[email protected]{DOMAIN}|0|3600|
    SRV|_autodiscover._tcp.{DOMAIN}.|1 443 discover.designrus.dk.|1|3600|
     

    Attached Files:

Share This Page