Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 12th June 2011, 13:23
HellMind HellMind is offline
Member
 
Join Date: Jul 2008
Posts: 99
Thanks: 4
Thanked 1 Time in 1 Post
Send a message via ICQ to HellMind Send a message via MSN to HellMind
Default Creating DNS record using the remote api

Code:
<?php
$client_id = '2'; //your client id, lo ignora
$client_group_id = '3';
$domain_name = $_REQUEST['domain'];
$server =1;
$mbox='info.x.com.';
$ns='ns1.x.com';
$ip='20x.21x.2x.1x';

#-------------------
$username = 'x';
$password = 'x';

$soap_location = 'http://localhost:8080/remote/index.php';
$soap_uri = 'http://localhost:8080/remote/';

$client = new SoapClient(null, array('location' => $soap_location, 'uri'      => $soap_uri));

$session_id = $client->login($username,$password);
//Registry Add
try {
        $params = array(
                'server_id' => $server,
                'origin' => $domain_name, //replace
                'ns' => $ns,
                'mbox' => $mbox,
                'refresh' => 28800,
                'retry' => 7200,
                'expire' => 604800,
                'minimum' => 86400,
                'ttl' => 86400,
                'xfer' => "",
                'also_notify' => "",
                'update_acl' => "",
                'active' => 'y',

        );
        $client->dns_zone_add($session_id, $client_id, $params);
}
catch (SoapFault $e) {
        die('Error: '.$e->getMessage());
}
//as add
try{
        $params = array(
                'server_id' => $server,
                'name' => '*',
                'data' => $ip,
                'ttl' => 86400,
                'active' => 'y',

        );
        $client->dns_a_add($session_id, $client_id, $params);
}
catch (SoapFault $e) {
        die('Error: '.$e->getMessage());
}
echo "Agregado";
?>
With this code I can add a new soa registry but the client owner is null, it works with every client but not the one I want , which is '2'.(No error apears it just looks like if I were using Id = 0)

The second problem is to add the 'a' record I need to know the id of the soa registry, how can I get that?
__________________
Ispconfig 3 Latest Version (Stable)
Debian Squeeze (esix vm)
Reply With Quote
Sponsored Links
  #2  
Old 14th June 2011, 12:48
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,801
Thanks: 840
Thanked 5,613 Times in 4,424 Posts
Default

Quote:
With this code I can add a new soa registry but the client owner is null, it works with every client but not the one I want , which is '2'.(No error apears it just looks like if I were using Id = 0)
Maybe you mix up sys_userid and client_id here. The client that you use has to exist, so please check that there is really a client with ID 2 in the "client" database table.

Quote:
The second problem is to add the 'a' record I need to know the id of the soa registry, how can I get that?
You get the ID back when you add the zone:

$client->dns_zone_add(....)
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
HellMind (14th June 2011)
  #3  
Old 14th June 2011, 14:48
HellMind HellMind is offline
Member
 
Join Date: Jul 2008
Posts: 99
Thanks: 4
Thanked 1 Time in 1 Post
Send a message via ICQ to HellMind Send a message via MSN to HellMind
Default

Quote:
Originally Posted by till View Post
Maybe you mix up sys_userid and client_id here. The client that you use has to exist, so please check that there is really a client with ID 2 in the "client" database table.
I found it in the db, also I choosed it using the drop down list box in the web interface where it shows the correct client id.

Code:
(2, 1, 1, 'riud', 'riud', '', 'xxxx. Com', 'xxx . Com', '', '', 'xxx 253', 'xx0', 'xxxxo', 'xxxe', 'AR', 'xxxxxxxxxxx7', '', '', '', 'http://xxxxxxx.com', '', '', 1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, 0, 0, 0, 1, NULL, -1, -1, 'no,fast-cgi,cgi,mod,suphp', -1, -1, -1, 0, 'no,jailkit', 0, 1, -1, -1, -1, 1, -1, 0, 'url', 5, -1, 0, 0, 'xxxxxer', '291ad281e640429285d30ff25b66813d', 'es', 'default', 0, '', NULL),
Maybe it does some validation that i cant pass.

Quote:
Originally Posted by till View Post
You get the ID back when you add the zone:

$client->dns_zone_add(....)
I will try it, thank you
__________________
Ispconfig 3 Latest Version (Stable)
Debian Squeeze (esix vm)
Reply With Quote
  #4  
Old 2nd July 2011, 19:00
HellMind HellMind is offline
Member
 
Join Date: Jul 2008
Posts: 99
Thanks: 4
Thanked 1 Time in 1 Post
Send a message via ICQ to HellMind Send a message via MSN to HellMind
Default

I'm having another issue,
After I add the dns records I must visit the ispc panel at the registry domain , its like the changes are not active till I do that.

Maybe I should call another function to refresh de mydns config?
__________________
Ispconfig 3 Latest Version (Stable)
Debian Squeeze (esix vm)
Reply With Quote
  #5  
Old 29th July 2011, 22:31
HellMind HellMind is offline
Member
 
Join Date: Jul 2008
Posts: 99
Thanks: 4
Thanked 1 Time in 1 Post
Send a message via ICQ to HellMind Send a message via MSN to HellMind
Default

I need a function to activate the new dns zone I 've added.
Where can I search for that?
__________________
Ispconfig 3 Latest Version (Stable)
Debian Squeeze (esix vm)
Reply With Quote
  #6  
Old 30th July 2011, 13:09
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,748 Times in 2,579 Posts
 
Default

In your registrar's control panel, you must make your ISPConfig DNS servers authoritative for your domain.

http://www.howtoforge.com/how-to-run...debian-squeeze
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix delivery problem erebus Installation/Configuration 8 29th July 2014 21:17
Google Apps dayjahone General 19 29th March 2008 18:25
ISPConfig 2.2.14 released till General 48 20th July 2007 00:46
No SPF record. beryl Installation/Configuration 6 17th May 2007 20:52
Problem with the apache (I can't start ist) M.Behrens Installation/Configuration 11 31st March 2006 11:48


All times are GMT +2. The time now is 17:09.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.