---
updatedAt: 2025-11-11T21:43:41.000Z
agentTools:
  projectIndex: https://domains.opensrs.guide/llms.txt
---

# advanced_update_nameservers

Adds nameservers to a domain, or adds or removes nameservers for a domain that already has nameservers assigned to it.

> 📘 Note:
>
> This command does not create a nameserver; the nameserver must already exist.
>
> This command is not supported for .DK. Use the [update\_all\_info](http://api.opensrs.com/v1.0/docs/update_all_info) command to change the nameservers for .DK domains.
>
> When you use this command to add or change nameservers for .IT domains, even though the response says the command was successful, the new nameservers are not activated immediately. The registry runs a series of tests against the nameservers before activating them. During the time that the tests are being run, any query about the domain, such as **get nameservers** or **getdomainall\_info**, will return the old nameservers. If the nameservers do not pass the registry tests within 30 days, the registry ignores the request. If you issue another **advanced\_update\_nameservers** command before the registry has completed their tests, the new command is assumed to refer to the old, currently active nameservers.

## Request parameters for advanced\_update\_nameservers

## Standard parameters

* **action** = advanced\_update\_nameservers
* **object** = domain

## Attributes

Parameters within the **attributes** associative array are described below.

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Parameter name
      </th>

      <th>
        Obligation
      </th>

      <th>
        Definition/Value
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        add\_ns
      </td>

      <td>
        Optional
      </td>

      <td>
        List of nameservers to add. This array cannot be submitted in the same command with the **assign\_ns** parameter, but can be submitted with **remove\_ns**.
      </td>
    </tr>

    <tr>
      <td>
        assign\_ns
      </td>

      <td>
        Optional
      </td>

      <td>
        List of nameservers to assign. This array cannot be submitted in the same command with the **add\_ns** or **remove\_ns** parameters.
      </td>
    </tr>

    <tr>
      <td>
        domain
      </td>

      <td>
        Required
      </td>

      <td>
        The relevant domain.
      </td>
    </tr>

    <tr>
      <td>
        op\_type
      </td>

      <td>
        Required
      </td>

      <td>
        The type of operation to perform on the object.

        Use **assign** when submitted with the **assign\_ns** array.

        Use **add\_remove** when submitted with the **add\_ns** or **remove\_ns** arrays.
      </td>
    </tr>

    <tr>
      <td>
        remove\_ns
      </td>

      <td>
        Optional
      </td>

      <td>
        List of nameservers to remove. This array cannot be submitted in the same command with the **assign\_ns** parameter, but can be submitted with **add\_ns**.
      </td>
    </tr>
  </tbody>
</Table>

## Response parameters for advanced\_update\_nameservers

## Standard parameters

* **action** = reply
* **object** = domain
* **is\_success** = a Boolean is returned, indicating success or failure of the\
  request
* **response\_code** = response code indicating outcome of the request
* **response\_text** = message describing the outcome of the request

## Examples for advanced\_update\_nameservers

**Request**

```xml Assign nameserver
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!DOCTYPE OPS_envelope SYSTEM 'ops.dtd'>
<OPS_envelope>
    <header>
        <version>0.9</version>
    </header>
    <body>
        <data_block>
            <dt_assoc>
                <item key="protocol">XCP</item>
                <item key="action">advanced_update_nameservers</item>
                <item key="object">domain</item>
                <item key="domain">yourdomain.com</item>
                <item key="attributes">
                    <dt_assoc>
                        <item key="assign_ns">
                            <dt_array>
                                <item key="0">ns1.example.com</item>
                                <item key="1">ns2.example.com</item>
                                <item key="2">ns3.example.com</item>
                                <item key="3">ns4.example.com</item>
                            </dt_array>
                        </item>
                        <item key="op_type">assign</item>
                    </dt_assoc>
                </item>
            </dt_assoc>
        </data_block>
    </body>
</OPS_envelope>
```
```xml Add or remove nameserver
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!DOCTYPE OPS_envelope SYSTEM 'ops.dtd'>
<OPS_envelope>
    <header>
        <version>0.9</version>
    </header>
    <body>
        <data_block>
            <dt_assoc>
                <item key="protocol">XCP</item>
                <item key="action">advanced_update_nameservers</item>
                <item key="object">domain</item>
                <item key="domain">yourdomain.com</item>
                <item key="attributes">
                    <dt_assoc>
                        <item key="op_type">add_remove</item>
                        <item key="remove_ns">
                            <dt_array>
                                <item key="0">ns1.example.com</item>
                                <item key="1">ns2.example.com</item>
                            </dt_array>
                        </item>
                        <item key="add_ns">
                            <dt_array>
                                <item key="0">ns4.example.com</item>
                                <item key="1">ns3.example.com</item>
                            </dt_array>
                        </item>
                    </dt_assoc>
                </item>
            </dt_assoc>
        </data_block>
    </body>
</OPS_envelope>
```

**Response**

```xml
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!DOCTYPE OPS_envelope SYSTEM 'ops.dtd'>
<OPS_envelope>
    <header>
        <version>0.9</version>
    </header>
    <body>
        <data_block>
            <dt_assoc>
                <item key="protocol">XCP</item>
                <item key="action">reply</item>
                <item key="object">domain</item>
                <item key="is_success">1</item>
                <item key="response_code">200</item>
                <item key="response_text">Command completed
                    successfully</item>
            </dt_assoc>
        </data_block>
    </body>
</OPS_envelope>
```