Update IP addresses in zone files

This function replaces a domain's IPv4 address in the DNS zone file with the specified destination IPv4 address.

SecurityBasicAuth
Request
query Parameters
dest_ip
required
string <ipv4>

The IPv4 address to use as the replacement in the zone files.

Example: dest_ip=192.0.2.1
domain
required
string <domain>

The domain to perform the zone file updates on.

Note:

To update multiple domains, increment or duplicate the parameter name. For example, domain-0, domain-1, and domain-2.

Examples:
domain=example.com domain-1=example1.com domain-2=example2.com
domain=example.com domain=example1.com domain=example2.com
domain=example.com
ftp_ip
string <ipv4>

The IPv4 address to use as the replacement for FTP records in the zone files.

If this parameter is not provided, then the system will use the dest_ip value.

Example: ftp_ip=192.0.2.1
source_ip
string <ipv4>

The IPv4 address to replace in the zone files. The detected source IPv4 address is one of:

  • If there is an A record for the root of the zone and the IP address is not a loopback address, then the system will use its address.
  • If there are any A records in the zone whose addresses are not loopback addresses, then the system will use the address of the first such A record in the zone file.
  • If no A records exist in the zone or all A records have loopback addresses, then the system will not update the zone file.

If you do not call this parameter, the system will automatically detect the IP addresses in the zone files.

Example: source_ip=192.0.2.0
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/DNS/swap_ip_in_zones
Request samples
uapi --user=username DNS swap_ip_in_zones domain='example.com' source_ip='192.0.2.0' dest_ip='192.0.2.1'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "swap_ip_in_zones",
  • "module": "DNS",
  • "result": {
    • "data": [
      • {
        • "zone_name": "example.com",
        • "record_name": "example.com",
        • "record_type": "A",
        • "old_value": "192.0.2.0",
        • "new_value": "192.0.2.1"
        }
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}