
12th June 2011, 12:23
|
|
Member
|
|
Join Date: Jul 2008
Posts: 96
Thanks: 4
Thanked 1 Time in 1 Post
|
|
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)
|

14th June 2011, 11:48
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,903
Thanks: 693
Thanked 4,193 Times in 3,211 Posts
|
|
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(....)
|
|
The Following User Says Thank You to till For This Useful Post:
|
|

14th June 2011, 13:48
|
|
Member
|
|
Join Date: Jul 2008
Posts: 96
Thanks: 4
Thanked 1 Time in 1 Post
|
|
Quote:
Originally Posted by till
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
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)
|

2nd July 2011, 18:00
|
|
Member
|
|
Join Date: Jul 2008
Posts: 96
Thanks: 4
Thanked 1 Time in 1 Post
|
|
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)
|

29th July 2011, 21:31
|
|
Member
|
|
Join Date: Jul 2008
Posts: 96
Thanks: 4
Thanked 1 Time in 1 Post
|
|
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)
|

30th July 2011, 12:09
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
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
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 01:14.
|
Recent comments
19 hours 26 min ago
1 day 2 hours ago
1 day 5 hours ago
1 day 7 hours ago
1 day 16 hours ago
2 days 1 hour ago
2 days 2 hours ago
2 days 5 hours ago
2 days 10 hours ago
2 days 10 hours ago