automated dns in perl or c for bind 8.x.x
S0LARlSTEK at aol.com
S0LARlSTEK at aol.com
Thu Nov 11 06:46:57 UTC 1999
Does anyone have a perl or c script that will make the dns process automated.
Heres an example:
(1) Create the domain.db files and put them in /var/named or wherever
designated by the script from a template file that might look something like
this. The program should have the capability of putting in different
domains, mail servers, IP addresses etc. Possibly by getting info from a
database file. Or being given different options.
;
; .db
; $Id$
;
@ IN SOA ns1.websgt.net. webmaster.websgt.net. (
ID_SERIAL# ; serial - yyyymmddhh
28800 ; refresh after 8 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL - 1 day
; Name Servers
IN NS ns1.websgt.net.
IN NS ns2.jtinternet.com.
;
ID_DOMAIN. IN MX _# ID_MAIL_SERVER.
localhost IN A 127.0.0.1
ID_DOMAIN. IN A ID_IP_ADDRESS
www.ID_DOMAIN. IN CNAME ID_DOMAIN.
(2) The program should also edit the /etc/named.conf file and keep the
contents in alphabetical order. Possibly by using a template that might look
like this,
for the master;
zone "ID_DOMAIN" in {
type master;
file "ID_DOMAIN.db";
};
for the slave;
zone "ID_DOMAIN" in {
type master;
file "ID_DOMAIN.db";
masters { 10.0.0.0; };
};
Such a perl script could be run from a web interface and write to a database
file then be kicked off by cron or if there is another way or if someone has
something written let me know because I am interested.
I am not a perl or c whiz.
Greg
More information about the bind-users
mailing list