Hi. I'm trying to get all the 'A' records of a domain, so I tried: $dns_records = $client->dns_a_get($session_id, $zone_id); where the $zone_id is the ID (not name - correcting) of a domain. It only returns a strange list like this, whereas there are many A records to that domain: Code: Debug: DNS records for zone XYZ.com.: Array ( [id] => 16 [sys_userid] => 3 [sys_groupid] => 3 [sys_perm_user] => riud [sys_perm_group] => riud [sys_perm_other] => [server_id] => 1 [zone] => 1 [name] => ns1.kalfa.uk. [type] => A [data] => 178.63.47.112 [aux] => 0 [ttl] => 86400 [active] => Y [stamp] => 2024-12-13 19:37:17 [serial] => 2024122301 )
$zone_id is not the domain; it's the ID of the zone (see database scheme of the dns_rr table). In your case, $zone_id = 1. In general, using a term like '_id' in a variable name suggests that it must be a unique number, not a text string.
My mistake I'm sorry, I was indeed using the NUMBER of the domain, 16 in my case as $zone_id. And still not getting all the A records.
The way you called that function is to return a single A-Record only. Try this instead: Code: $dns_records = $client->dns_a_get($session_id, ['zone' => $zone_id]);
I got my script working - it changes all the A and AAAA IP addresses of a domain from an old IP to a new IP. It's great after migrating a domain from old server to new. you just run it like: php update-domain-ips.php mydomain.com is there a place where I can place it so others might use it?
You can, e.g., make a thread for it here: https://forum.howtoforge.com/forums/plugins-modules-addons.34/ and attach your script as a .zip file to the thread.