Add demo to vCPE Public DNS 88/74288/2
authorBrian Freeman <bf1936@att.com>
Wed, 5 Dec 2018 18:37:37 +0000 (13:37 -0500)
committerBrian Freeman <bf1936@att.com>
Thu, 6 Dec 2018 17:15:39 +0000 (12:15 -0500)
Issue-ID: INT-755
Change-Id: I660c964cff60c33ae3f3c4aa9b47d2960789ea43
Signed-off-by: Brian Freeman <bf1936@att.com>
vnfs/vCPE/scripts/db_demo_onap_org [new file with mode: 0644]
vnfs/vCPE/scripts/named.conf.local [new file with mode: 0644]
vnfs/vCPE/scripts/named.conf.options [new file with mode: 0644]
vnfs/vCPE/scripts/v_dns_install.sh

diff --git a/vnfs/vCPE/scripts/db_demo_onap_org b/vnfs/vCPE/scripts/db_demo_onap_org
new file mode 100644 (file)
index 0000000..621dbd5
--- /dev/null
@@ -0,0 +1,15 @@
+;
+; BIND data file for local loopback interface
+;
+$TTL    604800
+@       IN      SOA     demo.onap.org. admin.demo.onap.org. (
+                              3         ; Serial
+                         604800         ; Refresh
+                          86400         ; Retry
+                        2419200         ; Expire
+                         604800 )       ; Negative Cache TTL
+; name servers - NS records
+    IN      NS      demo.onap.org.
+; name servers - A records
+demo.onap.org.                IN      A       10.2.0.1
+www.demo.onap.org.          IN      A       10.2.0.10
diff --git a/vnfs/vCPE/scripts/named.conf.local b/vnfs/vCPE/scripts/named.conf.local
new file mode 100644 (file)
index 0000000..fb3e5b5
--- /dev/null
@@ -0,0 +1,12 @@
+//
+// Do any local configuration here
+//
+
+// Consider adding the 1918 zones here, if they are not used in your
+// organization
+//include "/etc/bind/zones.rfc1918";
+
+zone "demo.onap.org" {
+        type master;
+        file "/etc/bind/zones/db.demo.onap.org"; # zone file path
+};
diff --git a/vnfs/vCPE/scripts/named.conf.options b/vnfs/vCPE/scripts/named.conf.options
new file mode 100644 (file)
index 0000000..1daa65c
--- /dev/null
@@ -0,0 +1,39 @@
+acl "trusted" {
+        x.x.x.x;
+};
+options {
+        directory "/var/cache/bind";
+
+        recursion no;                  # enables recursive queries
+        allow-recursion { trusted; };  # allows recursive queries from "trusted” clients i.e. LB only
+        listen-on { x.x.x.x; };                # ns1 IP address - listen on this address only
+        allow-transfer { none; };      # disable zone transfers by default
+
+        forwarders {
+                8.8.8.8;
+                8.8.4.4;
+        };
+
+
+        // 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.
+
+        // forwarders {
+        //      0.0.0.0;
+        // };
+
+        //========================================================================
+        // 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;
+
+        auth-nxdomain no;              # conform to RFC1035
+        listen-on-v6 { any; };
+};
index 81669d1..dfb0e08 100644 (file)
@@ -68,6 +68,13 @@ update-rc.d v_dns.sh defaults
 # Install Bind
 mkdir /etc/bind/zones
 sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9
+mv db_demo_onap_org /etc/bind/zones/db.demo.onap.org
+mv named.conf.options /etc/bind/
+mv named.conf.local /etc/bind/
+CPE_PUBLIC_IP=$(cat /opt/config/cpe_public_net_ipaddr.txt)
+sed -i "s/x.x.x.x/"$CPE_PUBLIC_IP"/g" /etc/bind/named.conf.options
+sleep 1
+
 
 # Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
 if [[ $CLOUD_ENV != "rackspace" ]]
@@ -81,4 +88,4 @@ then
        reboot
 fi
 
-./v_dns_init.sh
\ No newline at end of file
+./v_dns_init.sh