| Server IP : 186.226.61.20 / Your IP : 216.73.217.87 Web Server : Apache System : Linux bizybox.virtuaserver.com.br 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64 User : gesfood ( 1004) PHP Version : 8.2.36 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /scripts/ |
Upload File : |
#!/usr/local/cpanel/3rdparty/bin/perl
# Copyright 2026 WebPros International, LLC
# All rights reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited.
use strict;
use warnings;
use Cpanel::DnsUtils::AskDnsAdmin ();
use Cpanel::DnsUtils::Exists ();
use Cpanel::Hooks ();
use Cpanel::AcctUtils::DomainOwner::Tiny ();
local $SIG{'PIPE'} = 'IGNORE';
local $SIG{'HUP'} = 'IGNORE';
local $SIG{'ALRM'} = 'IGNORE';
if ( $ENV{'KILLDNS_ENTRY'} && $ENV{'KILLDNS_ENTRY'} eq '1' ) {
print "Loop prevented. Are your /usr/local/cpanel/scripts out of sync with your cPanel version in /usr/local/cpanel? Try running /usr/local/cpanel/scripts/upcp --sync\n";
exit 1;
}
$ENV{'KILLDNS_ENTRY'} = 1; #prevent looping
my $domain = @ARGV ? $ARGV[0] : '';
if ( $domain eq '' && -t STDIN ) {
print 'Enter the zone to delete? ';
chomp( $domain = <STDIN> );
}
if ( $domain eq '' ) {
print "Error: No zone specified\n";
exit;
}
$domain =~ s/\///g;
local $0 = "killdns - $domain";
my $owner = Cpanel::AcctUtils::DomainOwner::Tiny::getdomainowner( $domain, { 'default' => '' } );
my $zone_existed = Cpanel::DnsUtils::Exists::domainexists($domain);
if ($zone_existed) {
my $hook_data = { 'domain' => $domain, 'owner' => $owner };
my $pre_hook_info = {
'category' => 'Whostmgr',
'event' => 'Domain::zone_remove',
'stage' => 'pre',
'blocking' => 1,
};
my ( $pre_hook_result, $hook_msgs ) = Cpanel::Hooks::hook( $pre_hook_info, $hook_data );
if ( !$pre_hook_result ) {
print Cpanel::Hooks::hook_halted_msg( $pre_hook_info, $hook_msgs ) . "\n";
exit 1;
}
}
my $output = Cpanel::DnsUtils::AskDnsAdmin::askdnsadmin( 'REMOVEZONE', 0, $domain );
print $output;
if ( $zone_existed && !Cpanel::DnsUtils::Exists::domainexists($domain) ) {
Cpanel::Hooks::hook(
{
'category' => 'Whostmgr',
'event' => 'Domain::zone_remove',
'stage' => 'post',
},
{ 'domain' => $domain, 'owner' => $owner },
);
}