Browse Source

Add Bind9 to the repo

Robert Middleswarth 2 years ago
parent
commit
f1e7e1280e
4 changed files with 106 additions and 0 deletions
  1. 27 0
      configs/bind9/named.conf
  2. BIN
      images/bind9.png
  3. 43 0
      template/apps/bind9.json
  4. 36 0
      tools/install_bind9.sh

+ 27 - 0
configs/bind9/named.conf

@@ -0,0 +1,27 @@
+options {
+	directory "/var/cache/bind";
+
+	// If there is a firewall between you and nameservers you want
+	// to talk to, you may need to fix the firewall to allow multiple
+	// ports to talk.  See http://www.kb.cert.org/vuls/id/800113
+
+	// If your ISP provided one or more IP addresses for stable 
+	// nameservers, you probably want to use them as forwarders.  
+	// Uncomment the following block, and insert the addresses replacing 
+	// the all-0's placeholder.
+
+	// Set the IP addresses of your ISP's DNS servers:
+	// forwarders {
+	//	1.2.3.4;
+	//	5.6.7.8;
+	// };
+
+	//========================================================================
+	// If BIND logs error messages about the root key being expired,
+	// you will need to update your keys.  See https://www.isc.org/bind-keys
+	//========================================================================
+	dnssec-validation auto;
+
+	listen-on-v6 { any; };
+};
+

BIN
images/bind9.png


+ 43 - 0
template/apps/bind9.json

@@ -0,0 +1,43 @@
+{
+	"categories": [
+		"DNS",
+		"Tools"
+	],
+	"description": "BIND 9 provides software for Domain Name System (DNS) management including both defining domain names authoritatively for a given DNS zone, and recursively resolving domain names to their IP addresses. In addition to BIND 9's DNS server itself, named, this container also includes tools for performing DNS queries and dynamic updates. Read more on the BIND 9 https://www.isc.org/bind/ ",
+	"env": [
+		{
+			"default": "America/New_York",
+			"label": "TZ",
+			"name": "TZ"
+		}
+	],
+        "image_arm32": "ubuntu/bind9:latest",
+        "image_arm64": "ubuntu/bind9:latest",
+        "image_amd64": "ubuntu/bind9:latest",
+	"logo": "https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/images/bind9.png",
+	"name": "bind9",
+	"officialDoc": "https://hub.docker.com/r/ubuntu/bind9",
+	"platform": "linux",
+	"ports": [
+		"53:53/tcp",
+		"53:53/udp"
+	],
+	"restart_policy": "unless-stopped",
+	"title": "Bind9",
+	"type": 1,
+	"volumes": [
+		{
+			"bind": "/portainer/Files/AppData/Config/bind9/named.conf",
+			"container": "etc/bind/named.conf"
+		},
+		{
+			"bind": "/portainer/Files/AppData/Config/bind9/cache",
+			"container": "/var/cache/bind"
+		},
+		{
+			"bind": "/portainer/Files/AppData/Config/bind9/bind",
+			"container": "/var/lib/bind"
+		}
+	],
+	"webpage": "https://hub.docker.com/r/ubuntu/bind9"
+}

+ 36 - 0
tools/install_bind9.sh

@@ -0,0 +1,36 @@
+#!/bin/bash
+
+function error {
+  echo -e "\\e[91m$1\\e[39m"
+  exit 1
+}
+
+function check_internet() {
+  printf "Checking if you are online..."
+  wget -q --spider http://github.com
+  if [ $? -eq 0 ]; then
+    echo "Online. Continuing."
+  else
+    error "Offline. Go connect to the internet then run the script again."
+  fi
+}
+
+check_internet
+
+echo "Creating directories..."
+sudo mkdir -p /portainer/Files/AppData/Config/bind9/ || error "Failed to create config directory!"
+sudo mkdir -p /portainer/Files/AppData/Config/bind9/cache/ || error "Failed to create data directory for Prometheus!"
+sudo mkdir -p /portainer/Files/AppData/Config/bind9/bind/ || error "Failed to create data directory for Grafana!"
+echo "Downloading Prometheus config files if they don't exist"
+if [ -d /portainer/Files/AppData/Config/bind9/named.conf ];
+then
+    echo "/portainer/Files/AppData/Config/bind9/named.conf is a directory removing"
+    rm -rf '/portainer/Files/AppData/Config/bind9/named.conf'
+fi
+
+if [ ! -f /portainer/Files/AppData/Config/bind9/named.conf ]; 
+then
+	sudo wget -O /portainer/Files/AppData/Config/bind9/named.conf https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/configs/bind9/named.conf || error "Failed to download prometheus.yml file!"
+fi
+
+echo "Done You are ready to goto next step in the install document"