This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages: [1]
1
Other modules / Re: Import many DNS A records into Zentyal's DNS server zone via script
« on: November 21, 2016, 11:55:00 am »
OK. I found solution and wrote perl script.
There are some modernisations in script witch was published at https://forum.zentyal.org/index.php/topic,22580.msg86828.html#msg86828
Code: [Select]
#!/usr/bin/perl
use EBox::DNS;
use utf8;
use open ':std', ':encoding(UTF-8)';
EBox::init();
my $dns=EBox::DNS->_create;
my $domain='my.corporate.domain.com';
open(DF,"</home/administrator/hosts.txt") || die "Can't open pas-hosts: $!";
while(my $line = <DF>) {
chomp($line);
my ($ip, $hostname, @aliases) = split(/[\t\s]+/, $line);
my $host = {
name => $hostname,
ipAddresses => [ $ip ],
aliases => [ @aliases ],
readonly => 0
};
eval { $dns->addHost($domain, $host); };
$error = $@;
if ($error =~ /^$/) { print "Host $hostname added successfully.\n"; }
else { print "Error: " . $error . "\n"; };
}
close(DF);
There are some modernisations in script witch was published at https://forum.zentyal.org/index.php/topic,22580.msg86828.html#msg86828
2
Other modules / Import many DNS A records into Zentyal's DNS server zone via script
« on: November 17, 2016, 11:35:52 am »
I want to import many DNS A and PTR records into Zentyal's DNS server zone via script. I see that there is perl module EBox::DNS. Can i use it for my issue? And i can't find any documentation for this perl module.
Pages: [1]