Open main menu

CDOT Wiki β

Changes

Get-root-zone

1,378 bytes added, 07:22, 21 October 2020
no edit summary
[[Category:OPS535]][[Category:rchan]]
= Bash Script=
Sample Bash script for extracting Domain Registration wiki page [[Domainreg]] and create a root zone file.
Set the following shell (environment) variables before running the script to produce a customized zone file header for that root zone that match your DNS server:
* RNS_FQDN - set this to the fully qualified domain name of your root name server.
** <pre> export RNS_FQDN=rns.cp.net</pre>
* RNS_IP - set this to the IP address of your root name server.
* DNS_ADMIN_EMAIL - set this to the email address of your DNS administrator
** <pre> export DNS_ADMIN_EMAIL=admin.cp.net</pre>
<pre>
# email for dns admin
# RNS_FQDN, RNS_IP, DNS_ADMIN_EMAIL
# (c) 2020 - update for the new wiki url
#
if [ -z "${RNS_FQDN}" ]
then
fi
# start loading dns information from the web
url=httphttps://zenitwiki.senecaccdot.onsenecacollege.ca/wikiw/index.php/Domainreg
if [ ! -f raw.txt ]
#read xxx
done
</pre>
= Sample Output =
<pre>
$TTL 3600
@ IN SOA rns.cp.net. admin.cp.net. (1735109 1h 15m 30d 1h)
IN NS rns.cp.net.
rns.cp.net. IN A 192.168.99.253
cp.net. IN NS ns.cp.net.
ns.cp.net. IN A 192.168.99.1
Raymond.com. IN NS ns.raymond.com.
ns.raymond.com. IN A 192.168.98.53
gcyao.net. IN NS pri-dns.gcyao.net.
pri-dns.gcyao.net. IN A 192.168.33.53
bdgushue.com. IN NS pri-dns.bdgushue.com.
pri-dns.bdgushue.com. IN A 192.168.14.53
dcwood.com. IN NS pri-dns.dcwood.com.
pri-dns.dcwood.com. IN A 192.168.32.53
falli2.com. IN NS pri-dns.falli2.com.
pri-dns.falli2.com. IN A 192.168.2.53
tnemat.com. IN NS a2-dns.tnemat.com.
a2-dns.tnemat.com. IN A 192.168.25.53
accarneirobrandao.net. IN NS pri-dns.accarneirobrandao.net.
pri-dns.accarneirobrandao.net. IN A 192.168.7.53
</pre>
1,760
edits