From eaea8c1c57d1defa0d51dbc474b837cac7a284a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikki=20S=C3=B8rensen?= Date: Wed, 7 Mar 2018 00:17:02 +0100 Subject: [PATCH 1/2] unbound config making script --- scripts/unbound_conf.php | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 scripts/unbound_conf.php diff --git a/scripts/unbound_conf.php b/scripts/unbound_conf.php new file mode 100644 index 0000000..e8a57d8 --- /dev/null +++ b/scripts/unbound_conf.php @@ -0,0 +1,55 @@ + $value) + { + $value = trim($value, " \t\n\r\0\x0B"); + if (substr($value, 0,1) == "#") + { + $content = $value; + } + elseif (substr($value, 0,1) == "*") + { + $value = ltrim($value, '*'); + $value = ltrim($value, '.'); + + $content = "# ------ Wildcard replaced with local-zone data ------ #" . PHP_EOL; + $content = $content . 'local-zone: "' . $value . '" redirect' . PHP_EOL; + $content = $content . 'local-data: "' . $value . ' A ' . $server . '"' . PHP_EOL; + $content = $content . "# ---------------------------------------------------- #"; + } + else + { + $content = 'local-data: "' . $value . ' A ' . $server . '"'; + } + echo $content; + echo PHP_EOL; + } + echo PHP_EOL; + echo PHP_EOL; + } + } +} + +?> \ No newline at end of file From 288d5c647749ecb20028c327f12ab95fe301213d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikki=20S=C3=B8rensen?= Date: Wed, 7 Mar 2018 00:17:43 +0100 Subject: [PATCH 2/2] index page to make configs --- scripts/index.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scripts/index.php diff --git a/scripts/index.php b/scripts/index.php new file mode 100644 index 0000000..601993a --- /dev/null +++ b/scripts/index.php @@ -0,0 +1,24 @@ +print(); +} +else +{ + ?> + +
+
+ unbound
+ Other
+ Other2
+ +
+ + \ No newline at end of file