Hello Corion,
I really appreciate your views. I am trying this in my home machine. Can you please help me out with pointing out what is wrong with the code ?
I just want to create a zone file.
I am learning Perl and do not know much about regex.
The below is the entire code which I am using,
#!/usr/local/bin/perl
use strict;
use CGI ':standard';
use Cwd;
my $ipaddr = param('ipaddr');
my $domain = param('domain');
my $serial = `/bin/date +"%Y%m%d"00`;
print header(),
start_html('Zone created Successfully'),
"Zone created Successfully",
end_html();
open FILE, "+>", "/var/named/$domain.db";
print FILE "@ 86400 IN SOA ns1.eth1.in. ilugbelgaum.g
+mail.com. (
$serial ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ) ; minimum, seconds
$domain. 86400 IN NS ns1.eth1.in.
$domain. 86400 IN NS ns2.eth1.in.
$domain. IN A $ipaddr
localhost.$domain. IN A 127.0.0.1
$domain. IN MX 0 $domain.
mail IN CNAME $domain.
www IN CNAME $domain.
ftp IN CNAME $domain.
";
close FILE;
Thanks !
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.