Description

This function indicates whether the account's domains resolve exclusively to this server.

Examples


https://hostname.example.com:2083/cpsess##########/execute/DNS/ensure_domains_reside_only_locally?domain-1=example1.com&domain-2=example2.com&domain-3=example3.com

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Check the example1.com, example2.com, and example3.com domains to see if they resolve to the local server.
$poll = $cpanel->uapi(
    'DNS', 'ensure_domains_reside_only_locally',
    array(
        'domain-1' => 'example1.com',
        'domain-2' => 'example2.com',
        'domain-3' => 'example3.com'
  )
);

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
#  Check the example1.com, example2.com, and example3.com domains to see if they resolve to the local server.
my $poll = $cpliveapi->uapi(
    'DNS', 'ensure_domains_reside_only_locally',
    {
        'domain-1'  => 'example1.com',
        'domain-2'  => 'example2.com',
        'domain-3'  => 'example3.com'
  }
);

<!-- Check the example1.com, example2.com, and example3.com domains to see if they resolve to the local server. -->
[% execute('DNS', 'ensure_domains_reside_only_locally', { 'domain-1' => 'example1.com','domain-2'=>'example2.com','domain-3'=>'example3.com' } ) %]

uapi --user=username DNS ensure_domains_reside_only_locally domain-1=example1.com domain-2=example2.com domain-3=example3.com

{  
   "data":[  
      null,
      null,
      'The domain resolves to Mars. Beep beep beep.'
   ],
   "messages":null,
   "metadata":{  
      "transformed":1
   },
   "status":1,
   "errors":null
}

   

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain to check.

To check multiple domains, duplicate or increment the parameter name. For example, to check three domains, use the domain parameter multiple times or use the domain-1, domain-2, and domain-3 parameters.

A valid string.example1.com

 

Returns

ReturnTypeDescriptionPossible valuesExample
dataarray of strings

The results from each domain parameter's DNS query.

The function returns the results from the domains in the same order that you called them.

  • null — The domain only resolves locally to the server.
  • A valid string that explains to where the domain resolves.
The domain resolves to Mars. Beep beep beep.