---
title: "Zone update bulk"
url: "https://help.internetx.com/en/api/core-zone-update-bulk/"
lang: "en"
section: "API reference — API reference (XML/JSON)"
breadcrumb: "API documentation (JSON/XML) > Tasks > Zone tasks"
updated: "2023-09-19"
---

# Zone update bulk

## Function

The _ZoneUpdateBulk_ task updates several zones, on name servers managed by the system, in one job.

## Description

Route: PATCH /bulk/zone

Add and remove values from zone entries:

With the keyword `resourceRecordsAdd` you can change single zone entries of a subdomain, with the keyword `resourceRecordsRem` you can remove them.

**Examples for adding data**

In this example an A-record and an MX-record are added for the two zones bulk-1.test and bulk-2.test. For adding to multiple zones, multiple zone blocks can be inserted.

```
{
    "template": {
        "resourceRecordsAdd": [
            {
                "name": "sub1",
                "ttl": 600,
                "type": "A",
                "pref": 10,
                "value": "1.2.1.2"
			},
            {
                "name": "mail",
                "ttl": 600,
                "type": "MX",
                "pref": 10,
                "value": "1.2.1.2"
			}
		],
        "soa": {
            "refresh": 39940,
            "retry": 7200,
            "expire": 604800,
            "ttl": 86400,
            "email": "customer@example.com"
        }
    },

    "objects": [
        {
            "origin": "bulk-1.test",
            "virtualNameServer": "ns1.example.com"
		},
        {
            "origin": "bulk-2.test",
            "virtualNameServer": "ns1.example.com"
		}
	]
}
```

```
{
    "stid": "20201204-app1-dev-24993",
    "object": {
        "type": "Zone",
        "summary": 2
    },
    "data": [
        {
            "status": {
                "code": "S0202",
                "text": "Zone was updated successfully on the name server.",
                "type": "SUCCESS"
            },
            "object": {
                "type": "Zone",
                "value": "bulk-1.test",
                "data": {
                    "origin": "bulk-1.test",
                    "virtualNameServer": "ns1.example.com",
                    "roid": 164728
                }
            }
        },
        {
            "status": {
                "code": "S0202",
                "text": "Zone was updated successfully on the name server.",
                "type": "SUCCESS"
            },
            "object": {
                "type": "Zone",
                "value": "bulk-2.test",
                "data": {
                    "origin": "bulk-2.test",
                    "virtualNameServer": "ns1.example.com",
                    "roid": 164729
                }
            }
        }
    ]
}
```

**Examples for searching and replacing values**

This example searches for the TTL value, the " \* " means "Search all and replace with the value 1000". No `rr_add` or `rr_rem` blocks are required for this.

```
{
	"modifiers": [
		{
			"type": "TTL",
			"search": "*",
			"replace": "1000"
		}
	],
    "objects": [
        {
            "origin": "bulk-1.test",
            "virtualNameServer": "ns1.example.com"
		},
        {
            "origin": "bulk-2.test",
            "virtualNameServer": "ns2.example.com"
		}
	]	
}
```

```
{
    "stid": "20201204-app1-dev-25276",
    "object": {
        "type": "Zone",
        "summary": 2
    },
    "data": [
        {
            "status": {
                "code": "S0202",
                "text": "Zone was updated successfully on the name server.",
                "type": "SUCCESS"
            },
            "object": {
                "type": "Zone",
                "value": "bulk-1.test",
                "data": {
                    "origin": "bulk-1.test",
                    "virtualNameServer": "ns1.example.com",
                    "roid": 164728
                }
            }
        },
        {
            "status": {
                "code": "S0202",
                "text": "Zone was updated successfully on the name server.",
                "type": "SUCCESS"
            },
            "object": {
                "type": "Zone",
                "value": "bulk-2.test",
                "data": {
                    "origin": "bulk-2.test",
                    "virtualNameServer": "ns1.example.com",
                    "roid": 164729
                }
            }
        }
    ]
}
```

**Enter the authentication data for a BasicSSL certificate in the zone**

```
{
    "template": {
        "resourceRecordsAdd": [
            {
                "name": "sa8ck1zhwhphl9y037wu4qnjs6m8mnbo.bulk.test.",
                "ttl": 600,
                "type": "CNAME",
                "value": "s20160419103010.bulk.test."
			}
		],

    },

    "objects": [
        {
            "origin": "bulk-1.test",
            "virtualNameServer": "ns1.dev-lab.intern.autodns-lab.com"
		}
	]
}
```

```
{
    "stid": "20201204-app1-dev-1590",
    "object": {
        "type": "Zone",
        "summary": 1
    },
    "data": [
        {
            "status": {
                "code": "S0202",
                "text": "Zone was updated successfully on the name server.",
                "type": "SUCCESS"
            },
            "object": {
                "type": "Zone",
                "value": "bulk-1.test",
                "data": {
                    "origin": "bulk-1.test",
                    "virtualNameServer": "ns1.example.com",
                    "roid": 164728
                }
            }
        }
    ]
}

```

**Remove the authentication data of a BasicSSL certificate from the zone**

```
{
    "template": {
        "resourceRecordsRem": [
            {
                "name": "sa8ck1zhwhphl9y037wu4qnjs6m8mnbo.bulk.test.",
                "ttl": 600,
                "type": "CNAME",
                "value": "s20160419103010.bulk.test."
			}
		],

    },

    "objects": [
        {
            "origin": "bulk-1.test",
            "virtualNameServer": "ns1.dev-lab.intern.autodns-lab.com"
		}
	]
}
```

```
{
    "stid": "20201204-app1-dev-1680",
    "object": {
        "type": "Zone",
        "summary": 1
    },
    "data": [
        {
            "status": {
                "code": "S0202",
                "text": "Zone was updated successfully on the name server.",
                "type": "SUCCESS"
            },
            "object": {
                "type": "Zone",
                "value": "bulk-1.test",
                "data": {
                    "origin": "bulk-1.test",
                    "virtualNameServer": "ns1.example.com",
                    "roid": 164728
                }
            }
        }
    ]
}

```

 Task code 0202001  
 Uses [Zone](/de/api/core-objekt-zone/) object

Add and remove values from zone entries:  
With the keyword `rr_add` (resource record add) you can change single zone entries of a subdomain, with the keyword `rr_rem` (resource record remove) you can remove them.

Search and replace values of zone entries:  
With the keyword `search_and_replace` you can search for values and replace them with another value. Here `rr_add` or `rr_rem` blocks are not necessary, but can be used additionally without disturbing the functionality.

**Examples for adding data**

In this example an A-record and an MX-record are added for the two zones bulk-1.test and bulk-2.test. For adding to multiple zones, multiple zone blocks can be inserted.

```
<request>
	<auth>
		<user>customer</user>
		<password>passwort</password>
		<context>4</context>
	</auth>
	<task>
		<code>0202001</code>
		<default>
			<rr_add>
				<name>sub1</name>
				<type>A</type>
				<value>5.6.7.8</value>
			</rr_add>
			<rr_add>
				<name>mail</name>
				<type>MX</type>
				<value>mailserver.example.com</value>
			</rr_add>
			<soa>
				<refresh>39940</refresh>
				<retry>7200</retry>
				<expire>604800</expire>
				<ttl>86400</ttl>
			</soa>
		</default>
		<zone>
			<name>example1.com</name>
			<system_ns>ns1.example.com</system_ns>
		</zone>
		<zone>
			<name>example2.com</name>
			<system_ns>ns1.example.com</system_ns>
		</zone>
	</task>
</request>
```

```
<response>
	<result>
		<msg>
			<text>Zone was updated successfully on the name server.</text>
			<code>0202001</code>
			<type>success</type>
			<object>
				<type>zone</type>
				<value>example1.com</value>
			</object>
		</msg>
		<msg>
			<text>Zone was updated successfully on the name server.</text>
			<code>0202001</code>
			<type>success</type>
			<object>
				<type>zone</type>
				<value>example2.com</value>
			</object>
		</msg>
		<status>
			<code>S0202001</code>
			<text>Bulk zone update completed successfully.</text>
			<type>success</type>
		</status>
	</result>
	<stid>20130906-app1-test-7072</stid>
</response>
```

**Examples for searching and replacing values**

This example searches for the TTL value, the " \* " means "Search all and replace with the value 1000". No `rr_add` or `rr_rem` blocks are required for this.

```
<request>
     <auth>
         <user>customer</user>
         <password>passwort</password>
         <context>4</context>
     </auth>
     <task>
         <code>0202001</code>
         <default>
             <search_and_replace>
                 <search>*</search>
                 <type>TTL</type>
                 <replace>1000</replace>
             </search_and_replace>
             <soa>
                 <refresh>39940</refresh>
                 <retry>7200</retry>
                 <expire>604800</expire>
                 <ttl>86400</ttl>
             </soa>
         </default>
         <zone>
             <name>example.com</name>
             <system_ns>ns1.example.com</system_ns>
         </zone>
         <zone>
             <name>example2.com</name>
             <system_ns>ns1.example.com</system_ns>
         </zone>
     </task>
 </request>
```

```
<response>
	<result>
		<msg>
			<text>Zone was updated successfully on the name server.</text>
			<code>S0202</code>
			<type>success</type>
			<object>
				<type>zone</type>
				<value>example1.com</value>
			</object>
		</msg>
		<msg>
			<text>Zone was updated successfully on the name server.</text>
			<code>S0202</code>
			<type>success</type>
			<object>
				<type>zone</type>
				<value>example2.com</value>
			</object>
		</msg>
		<status>
			<code>S0202001</code>
			<text>Bulk zone update completed successfully.</text>
			<type>success</type>
		</status>
	</result>
	<stid>20130906-app1-test-7179</stid>
</response
```

**Enter the authentication data for a BasicSSL certificate in the zone**

```
request>
<auth>
	<user>customer</user>
	<password>passwort</password>
	<context>4</context>
</auth>
<task>
	<code>0202001</code>
	<default>
		<rr_add>
			<name>sa8ck1zhwhphl9y037wu4qnjs6m8mnbo.example.com.</name>
			<type>CNAME</type>
			<ttl>300</ttl>
			<value>s20160419103010.example.com.</value>
		</rr_add>
	</default>
	<zone>
		<name>example.com</name>
		<system_ns>ns1.example.com</system_ns>
	</zone>
</task>
</request>
```

```
<response>
	<result>
		<msg>
			<text>Zone was updated successfully on the name server.</text>
			<code>S0202001</code>
			<type>success</type>
			<object>
				<type>zone</type>
				<value>example.com</value>
			</object>
		</msg>
		<status>
			<code>S0202001</code>
			<textBulk zone update completed successfully.</text>
			<type>success</type>
		</status>
	</result>
	<stid>20130906-7072</stid>
</response>
```

Remove the authentication data of a BasicSSL certificate from the zone

```
<request>
	<auth>
		<user>customer</user>
		<password>passwort</password>
		<context>4</context>
	</auth>
	<task>
		<code>0202001</code>
		<default>
			<rr_rem>
				<name>sa8ck1zhwhphl9y037wu4qnjs6m8mnbo.example.com.</name>
				<type>CNAME</type>
				<ttl>600</ttl>
				<value>s20160419103010.example.com.</value>
			</rr_rem>
		</default>
		<zone>
			<name>example.com</name>
			<system_ns>ns1.example.com</system_ns>
		</zone>
	</task>
</request>
```

```
	<result>
		<msg>
			<text>Zone was updated successfully on the name server.</text>
			<code>S0202001</code>
			<type>success</type>
			<object>
				<type>zone</type>
				<value>example.com</value>
			</object>
		</msg>
		<status>
			<code>S0202001</code>
			<text>Bulk zone update completed successfully.</text>
			<type>success</type>
		</status>
	</result>
	<stid>20130906-7072</stid>
</response>
```

**Example: Remove or replace Main-IP**

With the optional keyword remove\_main\_ip you can decide when removing name server entries whether the main IP should also be removed or replaced with another one with a search-replace-query.

```
<request>
	<auth>
		<user>user</user>
		<password>password</password>
		<context>4</context>
	</auth>
	<task>
		<code>0202001</code>
		<default>
			<remove_main_ip>1</remove_main_ip>
			<search_and_replace>
				<search>1.2.3.4</search>
				<type>A</type>
				<replace></replace>
			</search_and_replace>
			<soa>
				<refresh>39940</refresh>
				<retry>7200</retry>
				<expire>604800</expire>
				<ttl>86400</ttl>
			</soa>
		</default>
		<zone>
			<name>examplezone.com</name>
			<system_ns>1.examplezone.de</system_ns>
			<main>
				<value>1.2.3.4</value>
				<ttl>86400</ttl>
			</main>
		</zone>
	</task>
</request>
```

```
<response> 
	<result>
		<msg>
			<text>Zone was updated successfully on the name server.</text>
			<code>S0202</code>
			<type>success</type>
			<object>
				<type>zone</type>
				<value>examplezone.com</value>
			</object>
		</msg>
		<status>
			<code>S0202001</code>
			<text>Bulk zone update completed successfully.</text>
			<type>success</type>
		</status>
	</result>
	<stid>20150429-app2-24590</stid>
</response>
```

### Possible Error Messages

-   EF02020 - No such zone exists.  
    
-   EF02060 - For the selected zone entry type a preference (pref) cannot be set.  
    
-   E0202 - Zone could not be updated on the name server.  
    
-   EF02093 -Name server group could no be found.
-   EF02013 - Secondary name server is invalid.  
    
-   E0242 - Subzone could not be updated.  
    
-   EF02025 - We don't administrate any of the entered name servers.
-   E0202002 - Zone could not be updated on the name server.
