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.

Authorizations:
query Parameters
dest_ip
required
string <ipv4>
Example: dest_ip=192.0.2.1

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

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

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.

ftp_ip
string <ipv4>
Example: ftp_ip=192.0.2.1

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.

source_ip
string <ipv4>
Example: source_ip=192.0.2.0

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.

Responses

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

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

Content type
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
    }
}