DNS Delete

Discussion in 'Installation/Configuration' started by Chris Owen, Jul 19, 2023.

Tags:
  1. Chris Owen

    Chris Owen New Member

    Hi
    I have recently just started to use the DNS server/feature. I think because I didn't enable this when I built the server I am having to play catch up.
    I was getting all types of errors for database and table missing for the DNS. I found another post explaining how to create the tables as below however when I try and make deletes I get:
    so it would seem I am still missing some tables. I can't seem to find dns_records in the source code, would someone be able to provided the create statement for this?

    Code:
    CREATE TABLE IF NOT EXISTS `records` (
        ->   `id` int(10) unsigned NOT NULL auto_increment,
        ->   `zone` varchar(255) NOT NULL,
        ->   `ttl` int(11) NOT NULL default '3600',
        ->   `type` varchar(255) NOT NULL,
        ->   `host` varchar(255) NOT NULL default '@',
        ->   `mx_priority` int(11) default NULL,
        ->   `data` text,
        ->   `primary_ns` varchar(255) default NULL,
        ->   `resp_contact` varchar(255) default NULL,
        ->   `serial` bigint(20) default NULL,
        ->   `refresh` int(11) default NULL,
        ->   `retry` int(11) default NULL,
        ->   `expire` int(11) default NULL,
        ->   `minimum` int(11) default NULL,
        ->   `ispconfig_id` int(11) NOT NULL,
        ->   PRIMARY KEY  (`id`),
        ->   KEY `type` (`type`),
        ->   KEY `host` (`host`),
        ->   KEY `zone` (`zone`)
        -> ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
    CREATE TABLE IF NOT EXISTS `records` (     ->   `id` int(10) unsigned NOT NULL auto_increment,     ->   `zone` varchar(255) NOT NULL,     ->   `ttl` int(11) NOT NULL default '3600',     ->   `type` varchar(255) NOT NULL,     ->   `host` varchar(255) NOT NULL default '@',     ->   `mx_priority` int(11) default NULL,     ->   `data` text,     ->   `primary_ns` varchar(255) default NULL,     ->   `resp_contact` varchar(255) default NULL,     ->   `serial` bigint(20) default NULL,     ->   `refresh` int(11) default NULL,     ->   `retry` int(11) default NULL,     ->   `expire` int(11) default NULL,     ->   `minimum` int(11) default NULL,     ->   `ispconfig_id` int(11) NOT NULL,     ->   PRIMARY KEY  (`id`),     ->   KEY `type` (`type`),     ->   KEY `host` (`host`),     ->   KEY `zone` (`zone`)     -> ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
    
    Code:
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] OS version is Debian GNU/Linux 11 (bullseye)
     
    [INFO] uptime:  08:58:03 up 10:41,  2 users,  load average: 0.16, 0.16, 0.17
     
    [INFO] memory:
                   total        used        free      shared  buff/cache   available
    Mem:            31Gi       2.6Gi        11Gi       166Mi        16Gi        28Gi
    Swap:           15Gi          0B        15Gi
     
    [INFO] systemd failed services status:
      UNIT LOAD ACTIVE SUB DESCRIPTION
    0 loaded units listed.
    
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.2.10p1
    
    
    ##### VERSION CHECK #####
    
    [INFO] php (cli) version is 8.1.21
    [INFO] php-cgi (used for cgi php in default vhost!) is version 8.1.21
    
    ##### PORT CHECK #####
    
    [WARN] Port 22 (SSH server) seems NOT to be listening
    
    ##### MAIL SERVER CHECK #####
    
    
    ##### RUNNING SERVER PROCESSES #####
    
    [INFO] I found the following web server(s):
        Unknown process (nginx:) (PID 51101)
    [INFO] I found the following mail server(s):
        Postfix (PID 2006)
    [INFO] I found the following pop3 server(s):
        Dovecot (PID 915)
    [INFO] I found the following imap server(s):
        Dovecot (PID 915)
    [INFO] I found the following ftp server(s):
        PureFTP (PID 2068)
    
    ##### LISTENING PORTS #####
    (only        ()
    Local        (Address)
    [anywhere]:993        (915/dovecot)
    [anywhere]:995        (915/dovecot)
    [localhost]:11332        (932/rspamd:)
    [localhost]:11333        (932/rspamd:)
    [localhost]:11334        (932/rspamd:)
    [localhost]:10023        (1808/postgrey)
    [anywhere]:587        (2006/master)
    [localhost]:6379        (931/redis-server)
    [anywhere]:22987        (1246/sshd:)
    [localhost]:11211        (918/memcached)
    [anywhere]:110        (915/dovecot)
    [anywhere]:143        (915/dovecot)
    [anywhere]:111        (1/init)
    [anywhere]:80        (51101/nginx:)
    [anywhere]:8080        (51101/nginx:)
    [anywhere]:8081        (51101/nginx:)
    [anywhere]:465        (2006/master)
    ***.***.***.***:53        (41777/named)
    ***.***.***.***:53        (41777/named)
    ***.***.***.***:53        (41777/named)
    ***.***.***.***:53        (41777/named)
    ***.***.***.***:53        (41777/named)
    ***.***.***.***:53        (41777/named)
    ***.***.***.***:53        (41777/named)
    ***.***.***.***:53        (41777/named)
    [localhost]:53        (41777/named)
    [localhost]:53        (41777/named)
    [localhost]:53        (41777/named)
    [localhost]:53        (41777/named)
    [localhost]:53        (41777/named)
    [localhost]:53        (41777/named)
    [localhost]:53        (41777/named)
    [localhost]:53        (41777/named)
    [anywhere]:21        (2068/pure-ftpd)
    [localhost]:953        (41777/named)
    [anywhere]:25        (2006/master)
    [anywhere]:443        (51101/nginx:)
    [anywhere]:4190        (915/dovecot)
    *:*:*:*::*:993        (915/dovecot)
    *:*:*:*::*:995        (915/dovecot)
    *:*:*:*::*:3306        (1313/mariadbd)
    *:*:*:*::*:587        (2006/master)
    *:*:*:*::*:6379        (931/redis-server)
    *:*:*:*::*:22987        (1246/sshd:)
    [localhost]10        (915/dovecot)
    [localhost]43        (915/dovecot)
    [localhost]11        (1/init)
    *:*:*:*::*:80        (51101/nginx:)
    *:*:*:*::*:8080        (51101/nginx:)
    *:*:*:*::*:8081        (51101/nginx:)
    *:*:*:*::*:465        (2006/master)
    *:*:*:*::*:21        (2068/pure-ftpd)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*:53        (41777/named)
    *:*:*:*::*468a:5bff:fed8:53        (41777/named)
    *:*:*:*::*468a:5bff:fed8:53        (41777/named)
    *:*:*:*::*468a:5bff:fed8:53        (41777/named)
    *:*:*:*::*468a:5bff:fed8:53        (41777/named)
    *:*:*:*::*468a:5bff:fed8:53        (41777/named)
    *:*:*:*::*468a:5bff:fed8:53        (41777/named)
    *:*:*:*::*468a:5bff:fed8:53        (41777/named)
    *:*:*:*::*468a:5bff:fed8:53        (41777/named)
    *:*:*:*::*:25        (2006/master)
    *:*:*:*::*:953        (41777/named)
    *:*:*:*::*:443        (51101/nginx:)
    *:*:*:*::*:6556        (914/cmk-agent-ctl)
    *:*:*:*::*:4190        (915/dovecot)
    
    
    
    
    ##### IPTABLES #####
    Chain INPUT (policy DROP)
    target     prot opt source               destination         
    f2b-dovecot  tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 110,995,143,993,587,465,4190
    f2b-postfix-sasl  tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 25
    ufw-before-logging-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-before-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-logging-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-reject-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-track-input  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain FORWARD (policy DROP)
    target     prot opt source               destination         
    ufw-before-logging-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-before-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-logging-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-reject-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-track-forward  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination         
    ufw-before-logging-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-before-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-logging-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-reject-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-track-output  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain f2b-dovecot (1 references)
    target     prot opt source               destination         
    REJECT     all  --  ***.***.***.***       [anywhere]/0            reject-with icmp-port-unreachable
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain f2b-postfix-sasl (1 references)
    target     prot opt source               destination         
    REJECT     all  --  ***.***.***.***         [anywhere]/0            reject-with icmp-port-unreachable
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-after-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-after-input (1 references)
    target     prot opt source               destination         
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:137
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:138
    ufw-skip-to-policy-input  tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:139
    ufw-skip-to-policy-input  tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:445
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:67
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:68
    ufw-skip-to-policy-input  all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type BROADCAST
    
    Chain ufw-after-logging-forward (1 references)
    target     prot opt source               destination         
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
    
    Chain ufw-after-logging-input (1 references)
    target     prot opt source               destination         
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
    
    Chain ufw-after-logging-output (1 references)
    target     prot opt source               destination         
    
    Chain ufw-after-output (1 references)
    target     prot opt source               destination         
    
    Chain ufw-before-forward (1 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0            ctstate RELATED,ESTABLISHED
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 3
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 11
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 12
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 8
    ufw-user-forward  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-before-input (1 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0           
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0            ctstate RELATED,ESTABLISHED
    ufw-logging-deny  all  --  [anywhere]/0            [anywhere]/0            ctstate INVALID
    DROP       all  --  [anywhere]/0            [anywhere]/0            ctstate INVALID
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 3
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 11
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 12
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 8
    ACCEPT     udp  --  [anywhere]/0            [anywhere]/0            udp spt:67 dpt:68
    ufw-not-local  all  --  [anywhere]/0            [anywhere]/0           
    ACCEPT     udp  --  [anywhere]/0            ***.***.***.***          udp dpt:5353
    ACCEPT     udp  --  [anywhere]/0            ***.***.***.***      udp dpt:1900
    ufw-user-input  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-before-logging-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-before-logging-input (1 references)
    target     prot opt source               destination         
    
    Chain ufw-before-logging-output (1 references)
    target     prot opt source               destination         
    
    Chain ufw-before-output (1 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0           
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0            ctstate RELATED,ESTABLISHED
    ufw-user-output  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-logging-allow (0 references)
    target     prot opt source               destination         
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW ALLOW] "
    
    Chain ufw-logging-deny (2 references)
    target     prot opt source               destination         
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ctstate INVALID limit: avg 3/min burst 10
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
    
    Chain ufw-not-local (1 references)
    target     prot opt source               destination         
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type LOCAL
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type MULTICAST
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type BROADCAST
    ufw-logging-deny  all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10
    DROP       all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-reject-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-reject-input (1 references)
    target     prot opt source               destination         
    
    Chain ufw-reject-output (1 references)
    target     prot opt source               destination         
    
    Chain ufw-skip-to-policy-forward (0 references)
    target     prot opt source               destination         
    DROP       all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-skip-to-policy-input (7 references)
    target     prot opt source               destination         
    DROP       all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-skip-to-policy-output (0 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-track-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-track-input (1 references)
    target     prot opt source               destination         
    
    Chain ufw-track-output (1 references)
    target     prot opt source               destination         
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            ctstate NEW
    ACCEPT     udp  --  [anywhere]/0            [anywhere]/0            ctstate NEW
    
    Chain ufw-user-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-user-input (1 references)
    target     prot opt source               destination         
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:21
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:22
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:25
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:53
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:80
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:110
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:143
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:443
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:465
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:587
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:993
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:995
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:3306
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:4190
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:8080
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:8081
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 40110:40210
    ACCEPT     udp  --  [anywhere]/0            [anywhere]/0            udp dpt:53
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:6556
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:22987
    
    Chain ufw-user-limit (0 references)
    target     prot opt source               destination         
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 5 LOG flags 0 level 4 prefix "[UFW LIMIT BLOCK] "
    REJECT     all  --  [anywhere]/0            [anywhere]/0            reject-with icmp-port-unreachable
    
    Chain ufw-user-limit-accept (0 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-user-logging-forward (0 references)
    target     prot opt source               destination         
    
    Chain ufw-user-logging-input (0 references)
    target     prot opt source               destination         
    
    Chain ufw-user-logging-output (0 references)
    target     prot opt source               destination         
    
    Chain ufw-user-output (1 references)
    target     prot opt source               destination         
    
    
    
    
    ##### LET'S ENCRYPT #####
    acme.sh is installed in /root/.acme.sh/acme.sh
    
    
     
  2. Chris Owen

    Chris Owen New Member

    I've managed to fix this by doing:
    Code:
    MariaDB [named]> CREATE TABLE dns_records (
        ->     id INT PRIMARY KEY,
        ->     domain_name VARCHAR(255) NOT NULL,
        ->     record_type VARCHAR(10) NOT NULL,
        ->     ip_address VARCHAR(45) NOT NULL,
        ->     ttl INT,
        ->     type VARCHAR(20) NOT NULL,
        ->     zone VARCHAR(100) NOT NULL,
        ->     created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
        -> );
    
    Not sure if this is correct or not but it seems to be working as expected.
    Many Thanks
    Chris
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no issue with the database, you just accidentally enabled a wrong server module manually, which is not used by normal DNS setups in ISPConfig. Run this command to fix your system:

    Code:
    rm -f /usr/local/ispconfig/server/plugins-enabled/bind_dlz_plugin.inc.php
    The DNS plugin used by ISPConfig when you want to run your own DNS server is the plugin bind_plugin.inc.php and not the disabled and deprecated and not working plugin bind_dlz_plugin.inc.php
     
    Last edited: Jul 19, 2023
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    This table must be deleted, it does not belong to ISPConfig and shall not exist in the dbispconfig database.
     
  5. Chris Owen

    Chris Owen New Member

    @till thank you, I will make the changes you suggest. Thanks for your fast reply!
     
    till likes this.

Share This Page