Skip to Content.
Sympa Menu

discuss - Re: [opennic-discuss] Winning still feels terrible – temporary pause in service from ns10,ns19.tx.us

discuss AT lists.opennicproject.org

Subject: Discuss mailing list

List archive

Re: [opennic-discuss] Winning still feels terrible – temporary pause in service from ns10,ns19.tx.us


Chronological Thread 
  • From: Quinn Wood <wood.quinn.s AT gmail.com>
  • To: discuss AT lists.opennicproject.org
  • Subject: Re: [opennic-discuss] Winning still feels terrible – temporary pause in service from ns10,ns19.tx.us
  • Date: Wed, 11 Dec 2013 17:31:58 -0600

And this will create said local nameserver.

# I recommend an empty /etc/bind and /var/named for this script. Then run
# # ./create.sh > /etc/bind/named.conf

# Start the configuration file off with some basics:
# First a commented-out whitelist, in case you want a whitelist setup.
echo "/*include \"/var/named/whitelist.conf\";*/"
echo ""

# The allow-query and allow-recursion options to restrict who can use the
# nameserver. Again, the whitelist parts are commented out. In this case you'd
# remove the second allow-recursion option if you wanted a whitelist.
echo "options {"
echo "/* allow-query { whitelist; };"
echo "/* allow-recursion { whitelist; };*/"
echo " allow-recursion { any; };"
# The directory path used in this file is /var/named.
echo " directory \"/var/named\";"
# This configuration hides the version information bind can give out.
echo " version \"[hidden]\";"
echo "};"
echo ""

# Setting up a masters list removes the need to copy each IP to each zone
# below.
echo "masters \"tier-1\" {"
# This gets a list of tier 1 hostnames and puts them into a loop, then
# retrieves each server's IPv4/IPv6 addresses.
# FIXME: This'll break if a server has more than# one IPv4 or IPv6 address.
for hostname in $(dig -q . -t NS | awk '/NS\t/ { print $5 }' | sort); do
echo " $(dig +short -q ${hostname} -t A); /*${hostname} IPv4*/"
echo " $(dig +short -q ${hostname} -t AAAA); /*${hostname} IPv6*/"
done | grep -v "^ ;"
echo "};"
echo ""

# This gets a list of OpenNIC sponsored TLDs and puts them into a loop, then
# retrieves each TLD's SOA record to determine its primary DNS server. The
# zone configuration is then output.
# FIXME: This'll break if a server has more than# one IPv4 or IPv6 address.
for zone in $(dig +short -q tlds.opennic.glue -t TXT | tr -d '"' |
sort) dns.opennic.glue; do
echo "zone \"$zone\" in {"
echo " type slave;"
echo " file \"db.${zone}\";"
echo " masters { tier-1; };"
echo "};"
done

# This gets a list of OpenNIC sponsored TLDs and puts them into a loop, then
# does an AXFR to the destination zonefile.
for zone in $(dig +short -q tlds.opennic.glue -t TXT | tr -d '"' |
sort) dns.opennic.glue; do
dig -q $(echo ${zone}. | sed 's/\.\././') -t AXFR > /var/named/db.${zone}
done



Archive powered by MHonArc 2.6.19.

Top of Page