]> git.ipfire.org Git - dbl.git/commitdiff
db: Add NS records to the zones
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 6 Dec 2025 17:39:16 +0000 (17:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 6 Dec 2025 17:39:16 +0000 (17:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.sql

index 3bb75856d4cf69a4ffea14a1eba015363705b8f1..5128fef8571b7feeeb15c290a83d20f9a591659b 100644 (file)
@@ -2,7 +2,7 @@
 -- PostgreSQL database dump
 --
 
-\restrict lKLDtx9usnrI5oagNTAJGCh4DQFB5EhlTwRbiSmcjtxczaiSLvMMmoCJDe8NM1A
+\restrict d8A3UVdiSzd0Unyfv1aRknScqoOhBfndUbrsHKEX78YI6cYH8BoL3f5W881qFx7
 
 -- Dumped from database version 17.6 (Debian 17.6-0+deb13u1)
 -- Dumped by pg_dump version 17.6 (Debian 17.6-0+deb13u1)
@@ -103,6 +103,37 @@ CREATE SEQUENCE public.lists_id_seq
 ALTER SEQUENCE public.lists_id_seq OWNED BY public.lists.id;
 
 
+--
+-- Name: nameservers; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.nameservers (
+    id integer NOT NULL,
+    name text NOT NULL,
+    ttl integer DEFAULT 86400 NOT NULL
+);
+
+
+--
+-- Name: nameservers_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.nameservers_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+--
+-- Name: nameservers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.nameservers_id_seq OWNED BY public.nameservers.id;
+
+
 --
 -- Name: source_domains; Type: TABLE; Schema: public; Owner: -
 --
@@ -152,6 +183,18 @@ CREATE VIEW public.records AS
             ''::text AS ordername,
             true AS auth
            FROM public.lists
+        UNION ALL
+         SELECT lists.id,
+            (lists.slug || '.dnsbl.ipfire.org'::text),
+            'NS'::text,
+            (nameservers.name || '.'::text),
+            nameservers.ttl,
+            0,
+            false,
+            ''::text,
+            true
+           FROM public.lists,
+            public.nameservers
         UNION ALL
          SELECT lists.id AS domain_id,
             (((source_domains.name || '.'::text) || lists.slug) || '.dnsbl.ipfire.org'::text) AS name,
@@ -227,6 +270,13 @@ ALTER SEQUENCE public.sources_id_seq OWNED BY public.sources.id;
 ALTER TABLE ONLY public.lists ALTER COLUMN id SET DEFAULT nextval('public.lists_id_seq'::regclass);
 
 
+--
+-- Name: nameservers id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.nameservers ALTER COLUMN id SET DEFAULT nextval('public.nameservers_id_seq'::regclass);
+
+
 --
 -- Name: source_domains id; Type: DEFAULT; Schema: public; Owner: -
 --
@@ -249,6 +299,14 @@ ALTER TABLE ONLY public.lists
     ADD CONSTRAINT lists_pkey PRIMARY KEY (id);
 
 
+--
+-- Name: nameservers nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.nameservers
+    ADD CONSTRAINT nameservers_pkey PRIMARY KEY (id);
+
+
 --
 -- Name: source_domains source_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 --
@@ -306,5 +364,5 @@ ALTER TABLE ONLY public.sources
 -- PostgreSQL database dump complete
 --
 
-\unrestrict lKLDtx9usnrI5oagNTAJGCh4DQFB5EhlTwRbiSmcjtxczaiSLvMMmoCJDe8NM1A
+\unrestrict d8A3UVdiSzd0Unyfv1aRknScqoOhBfndUbrsHKEX78YI6cYH8BoL3f5W881qFx7