StartingNmap7.91 ( https://nmap.org ) at 2021-10-08 21:57 CST Nmap scan report for 10.10.10.244 Host is up (0.56s latency). Not shown: 997 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 307205:7c:5e:b1:83:f9:4f:ae:2f:08:e1:33:ff:f5:83:9e (RSA) | 2563f:73:b4:95:72:ca:5e:33:f6:8a:8f:46:cf:43:35:b9 (ECDSA) |_ 256cc:0a:41:b7:a1:9a:43:da:1b:68:f5:2a:f8:2a:75:2c (ED25519) 53/tcp open domain ISC BIND 9.16.1 (Ubuntu Linux) | dns-nsid: |_ bind.version: 9.16.1-Ubuntu 80/tcp open http Apache httpd 2.4.41 ((Ubuntu)) |_http-server-header: Apache/2.4.41 (Ubuntu) |_http-title: Dyna DNS Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 27.00 seconds
# This script generates named.conf.bindmgr to workaround the problem # that bind/named can only include single files but no directories. # # It creates a named.conf.bindmgr file in /etc/bind that can be included # from named.conf.local (or others) and will include all files from the # directory /etc/bin/named.bindmgr. # # NOTE: The script is work in progress. For now bind is not including # named.conf.bindmgr. # # TODO: Currently the script is only adding files to the directory but # not deleting them. As we generate the list of files to be included # from the source directory they won't be included anyway.
# Check versioning (.version) echo"[+] Running $0 to stage new configuration from $PWD." if [[ ! -f .version ]] ; then echo"[-] ERROR: Check versioning. Exiting." exit 42 fi if [[ "`cat .version 2>/dev/null`" -le "`cat $BINDMGR_DIR/.version 2>/dev/null`" ]] ; then echo"[-] ERROR: Check versioning. Exiting." exit 43 fi
# Create config file that includes all files from named.bindmgr. echo"[+] Creating $BINDMGR_CONF file." printf'// Automatically generated file. Do not modify manually.\n' > $BINDMGR_CONF for file in * ; do printf'include "/etc/bind/named.bindmgr/%s";\n'"$file" >> $BINDMGR_CONF done
# Stage new version of configuration files. echo"[+] Staging files to $BINDMGR_DIR." cp .version * /etc/bind/named.bindmgr/
# Check generated configuration with named-checkconf. echo"[+] Checking staged configuration." named-checkconf $BINDMGR_CONF >/dev/null if [[ $? -ne 0 ]] ; then echo"[-] ERROR: The generated configuration is not valid. Please fix following errors: " named-checkconf $BINDMGR_CONF 2>&1 | indent exit 44 else echo"[+] Configuration successfully staged." # *** TODO *** Uncomment restart once we are live. # systemctl restart bind9 if [[ $? -ne 0 ]] ; then echo"[-] Restart of bind9 via systemctl failed. Please check logfile: " systemctl status bind9 else echo"[+] Restart of bind9 via systemctl succeeded." fi fi