pdns-db.sql 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. /*
  2. How this was generated:
  3. 1. bring up an empty pdns stack
  4. 2. use api to create a zone ...
  5. curl -X POST \
  6. 'http://npm.dev:8081/api/v1/servers/localhost/zones' \
  7. --header 'X-API-Key: npm' \
  8. --header 'Content-Type: application/json' \
  9. --data-raw '{
  10. "name": "example.com.",
  11. "kind": "Native",
  12. "masters": [],
  13. "nameservers": [
  14. "ns1.pdns.",
  15. "ns2.pdns."
  16. ]
  17. }'
  18. 3. Dump sql:
  19. docker exec -ti npm.pdns.db mysqldump -u pdns -p pdns
  20. */
  21. ----------------------------------------------------------------------
  22. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  23. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  24. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  25. /*!40101 SET NAMES utf8mb4 */;
  26. /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  27. /*!40103 SET TIME_ZONE='+00:00' */;
  28. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  29. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  30. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  31. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  32. --
  33. -- Table structure for table `comments`
  34. --
  35. DROP TABLE IF EXISTS `comments`;
  36. /*!40101 SET @saved_cs_client = @@character_set_client */;
  37. /*!40101 SET character_set_client = utf8 */;
  38. CREATE TABLE `comments` (
  39. `id` int(11) NOT NULL AUTO_INCREMENT,
  40. `domain_id` int(11) NOT NULL,
  41. `name` varchar(255) NOT NULL,
  42. `type` varchar(10) NOT NULL,
  43. `modified_at` int(11) NOT NULL,
  44. `account` varchar(40) CHARACTER SET utf8mb3 DEFAULT NULL,
  45. `comment` text CHARACTER SET utf8mb3 NOT NULL,
  46. PRIMARY KEY (`id`),
  47. KEY `comments_name_type_idx` (`name`,`type`),
  48. KEY `comments_order_idx` (`domain_id`,`modified_at`)
  49. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  50. /*!40101 SET character_set_client = @saved_cs_client */;
  51. --
  52. -- Dumping data for table `comments`
  53. --
  54. LOCK TABLES `comments` WRITE;
  55. /*!40000 ALTER TABLE `comments` DISABLE KEYS */;
  56. /*!40000 ALTER TABLE `comments` ENABLE KEYS */;
  57. UNLOCK TABLES;
  58. --
  59. -- Table structure for table `cryptokeys`
  60. --
  61. DROP TABLE IF EXISTS `cryptokeys`;
  62. /*!40101 SET @saved_cs_client = @@character_set_client */;
  63. /*!40101 SET character_set_client = utf8 */;
  64. CREATE TABLE `cryptokeys` (
  65. `id` int(11) NOT NULL AUTO_INCREMENT,
  66. `domain_id` int(11) NOT NULL,
  67. `flags` int(11) NOT NULL,
  68. `active` tinyint(1) DEFAULT NULL,
  69. `published` tinyint(1) DEFAULT 1,
  70. `content` text DEFAULT NULL,
  71. PRIMARY KEY (`id`),
  72. KEY `domainidindex` (`domain_id`)
  73. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  74. /*!40101 SET character_set_client = @saved_cs_client */;
  75. --
  76. -- Dumping data for table `cryptokeys`
  77. --
  78. LOCK TABLES `cryptokeys` WRITE;
  79. /*!40000 ALTER TABLE `cryptokeys` DISABLE KEYS */;
  80. /*!40000 ALTER TABLE `cryptokeys` ENABLE KEYS */;
  81. UNLOCK TABLES;
  82. --
  83. -- Table structure for table `domainmetadata`
  84. --
  85. DROP TABLE IF EXISTS `domainmetadata`;
  86. /*!40101 SET @saved_cs_client = @@character_set_client */;
  87. /*!40101 SET character_set_client = utf8 */;
  88. CREATE TABLE `domainmetadata` (
  89. `id` int(11) NOT NULL AUTO_INCREMENT,
  90. `domain_id` int(11) NOT NULL,
  91. `kind` varchar(32) DEFAULT NULL,
  92. `content` text DEFAULT NULL,
  93. PRIMARY KEY (`id`),
  94. KEY `domainmetadata_idx` (`domain_id`,`kind`)
  95. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  96. /*!40101 SET character_set_client = @saved_cs_client */;
  97. --
  98. -- Dumping data for table `domainmetadata`
  99. --
  100. LOCK TABLES `domainmetadata` WRITE;
  101. /*!40000 ALTER TABLE `domainmetadata` DISABLE KEYS */;
  102. INSERT INTO `domainmetadata` VALUES
  103. (1,1,'SOA-EDIT-API','DEFAULT');
  104. /*!40000 ALTER TABLE `domainmetadata` ENABLE KEYS */;
  105. UNLOCK TABLES;
  106. --
  107. -- Table structure for table `domains`
  108. --
  109. DROP TABLE IF EXISTS `domains`;
  110. /*!40101 SET @saved_cs_client = @@character_set_client */;
  111. /*!40101 SET character_set_client = utf8 */;
  112. CREATE TABLE `domains` (
  113. `id` int(11) NOT NULL AUTO_INCREMENT,
  114. `name` varchar(255) NOT NULL,
  115. `master` varchar(128) DEFAULT NULL,
  116. `last_check` int(11) DEFAULT NULL,
  117. `type` varchar(8) NOT NULL,
  118. `notified_serial` int(10) unsigned DEFAULT NULL,
  119. `account` varchar(40) CHARACTER SET utf8mb3 DEFAULT NULL,
  120. `options` varchar(64000) DEFAULT NULL,
  121. `catalog` varchar(255) DEFAULT NULL,
  122. PRIMARY KEY (`id`),
  123. UNIQUE KEY `name_index` (`name`),
  124. KEY `catalog_idx` (`catalog`)
  125. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  126. /*!40101 SET character_set_client = @saved_cs_client */;
  127. --
  128. -- Dumping data for table `domains`
  129. --
  130. LOCK TABLES `domains` WRITE;
  131. /*!40000 ALTER TABLE `domains` DISABLE KEYS */;
  132. INSERT INTO `domains` VALUES
  133. (1,'example.com','',NULL,'NATIVE',NULL,'',NULL,NULL);
  134. /*!40000 ALTER TABLE `domains` ENABLE KEYS */;
  135. UNLOCK TABLES;
  136. --
  137. -- Table structure for table `records`
  138. --
  139. DROP TABLE IF EXISTS `records`;
  140. /*!40101 SET @saved_cs_client = @@character_set_client */;
  141. /*!40101 SET character_set_client = utf8 */;
  142. CREATE TABLE `records` (
  143. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  144. `domain_id` int(11) DEFAULT NULL,
  145. `name` varchar(255) DEFAULT NULL,
  146. `type` varchar(10) DEFAULT NULL,
  147. `content` varchar(64000) DEFAULT NULL,
  148. `ttl` int(11) DEFAULT NULL,
  149. `prio` int(11) DEFAULT NULL,
  150. `disabled` tinyint(1) DEFAULT 0,
  151. `ordername` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
  152. `auth` tinyint(1) DEFAULT 1,
  153. PRIMARY KEY (`id`),
  154. KEY `nametype_index` (`name`,`type`),
  155. KEY `domain_id` (`domain_id`),
  156. KEY `ordername` (`ordername`)
  157. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  158. /*!40101 SET character_set_client = @saved_cs_client */;
  159. --
  160. -- Dumping data for table `records`
  161. --
  162. LOCK TABLES `records` WRITE;
  163. /*!40000 ALTER TABLE `records` DISABLE KEYS */;
  164. INSERT INTO `records` VALUES
  165. (1,1,'example.com','NS','ns1.pdns',1500,0,0,NULL,1),
  166. (2,1,'example.com','NS','ns2.pdns',1500,0,0,NULL,1),
  167. (3,1,'example.com','SOA','a.misconfigured.dns.server.invalid hostmaster.example.com 2023030501 10800 3600 604800 3600',1500,0,0,NULL,1);
  168. /*!40000 ALTER TABLE `records` ENABLE KEYS */;
  169. UNLOCK TABLES;
  170. --
  171. -- Table structure for table `supermasters`
  172. --
  173. DROP TABLE IF EXISTS `supermasters`;
  174. /*!40101 SET @saved_cs_client = @@character_set_client */;
  175. /*!40101 SET character_set_client = utf8 */;
  176. CREATE TABLE `supermasters` (
  177. `ip` varchar(64) NOT NULL,
  178. `nameserver` varchar(255) NOT NULL,
  179. `account` varchar(40) CHARACTER SET utf8mb3 NOT NULL,
  180. PRIMARY KEY (`ip`,`nameserver`)
  181. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  182. /*!40101 SET character_set_client = @saved_cs_client */;
  183. --
  184. -- Dumping data for table `supermasters`
  185. --
  186. LOCK TABLES `supermasters` WRITE;
  187. /*!40000 ALTER TABLE `supermasters` DISABLE KEYS */;
  188. /*!40000 ALTER TABLE `supermasters` ENABLE KEYS */;
  189. UNLOCK TABLES;
  190. --
  191. -- Table structure for table `tsigkeys`
  192. --
  193. DROP TABLE IF EXISTS `tsigkeys`;
  194. /*!40101 SET @saved_cs_client = @@character_set_client */;
  195. /*!40101 SET character_set_client = utf8 */;
  196. CREATE TABLE `tsigkeys` (
  197. `id` int(11) NOT NULL AUTO_INCREMENT,
  198. `name` varchar(255) DEFAULT NULL,
  199. `algorithm` varchar(50) DEFAULT NULL,
  200. `secret` varchar(255) DEFAULT NULL,
  201. PRIMARY KEY (`id`),
  202. UNIQUE KEY `namealgoindex` (`name`,`algorithm`)
  203. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  204. /*!40101 SET character_set_client = @saved_cs_client */;
  205. --
  206. -- Dumping data for table `tsigkeys`
  207. --
  208. LOCK TABLES `tsigkeys` WRITE;
  209. /*!40000 ALTER TABLE `tsigkeys` DISABLE KEYS */;
  210. /*!40000 ALTER TABLE `tsigkeys` ENABLE KEYS */;
  211. UNLOCK TABLES;
  212. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  213. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  214. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  215. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  216. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  217. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  218. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  219. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;