Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameters for addzonrecord #16

Open
ajdove opened this issue Nov 23, 2014 · 1 comment
Open

parameters for addzonrecord #16

ajdove opened this issue Nov 23, 2014 · 1 comment

Comments

@ajdove
Copy link

ajdove commented Nov 23, 2014

I have read the documentation for cPanel_XMLAP_Client_Class addzonerecord() . I am relatively new to the concept of editing dns settings. It gives the required parameters as :
* @param string $zone The DNS zone that you want to add the record to
* @param array $args Associative array representing the record to be added
What is the name of the zone record so as I can use it as a parameter?
and:
Where can I get a list of the required fields and their format for the array?
for example is this the right idea? or close to it?

I have searched the cPanel documentation but have been unable to come up with an answer.

@integrateddigital
Copy link

@ajdove

I think the record name in this case would be the slt.tld. ( not the period at the end )
...... [ if you look at how DNS records are setup .. this is inherited from @ .. hostname and period )
here's an example of editing a zone with arguments ..

  1. read the zone and find the line# you want to edit
  2. edit the zone providing that line#

I understand you are trying to Add rather than Edit, but perhaps this will shed some light, giving
the $recordname is the same in this case;

( for adding a zone we actually use addondomain api 2 - it creates it in cpanel, and also creates the dns zone, ping me if you want an example of that too ) ..

hope it helps:

for #1:
.. $fetch_zone = $json_client->api2_query( $cpaneluser, 'ZoneEdit', 'fetchzone', $domainarg ) ;
( and $domainarg is $domainarg = array ( 'domain' => $domain, 'type' => 'A'); - in
our case, we are looking into editing the A pointing )

for #2:
$resultstr = $json_client->api2_query( $auth_user, 'ZoneEdit', 'edit_zone_record', $dnsargs );

but in this case the $dnsargs would be:
$dnsargs = array('Line' => $DNS_RECORD_LINE_NUMBER, 'domain' => $domain,
'name' => $record_name, 'type' => 'A', 'address' => $ip2go,
'ttl' => '14400', 'class' => 'IN',
);

where:
-$DNS_RECORD_LINE_NUMBER was fetched on #1
now the $record that you are asking about should be:
-$record is the domain name that you are adding -with a period ( domain.com. <-note period at the end)
-$type is A .. in our context.
..

hope that helps,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants