DNS zone file import always fails
Summary
Importing a DNS zone file always fails with the following error:
This zone is not allowed for this account.
This zone file appears invalid.
Steps to reproduce
- Go to the Zone File Import page
- Select a client and domain
- Click "Browse" and select a valid DNS zone file
- Click "Import Zonefile" - Nothing happens
- Open the browser dev tools, go to the Network tab, find the request to
/dns/dns_import.php
and check the Response.
Correct behaviour
The zone file should be imported
Environment
Server OS + version: Debian 10
ISPConfig version: 3.2.8p1
Software version of the related software:
# apachectl -v
Server version: Apache/2.4.38 (Debian)
Server built: 2021-12-21T16:50:43
# php -v
PHP 7.3.33-1+0~20211119.91+debian10~1.gbp618351 (cli) (built: Nov 19 2021 06:39:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.33-1+0~20211119.91+debian10~1.gbp618351, Copyright (c) 1999-2018, by Zend Technologies
Proposed fix
This is because the valid domain check is done by passing the domain name into checkDomainModuleDomain, which is expecting a domain ID.
Edited by Thom