4.7 Deleting a Zone Scope

The following example specifies how to delete an existing zone scope named "example_americas" in example.com created in section 4.6. This operation is allowed on both file-backed and Active Directory integrated zones.

The client calls R_DnssrvOperation2 (section 3.1.4.6) and provides the following parameters:

  • DNS_RPC_CURRENT_CLIENT_VER (section 2.2.1.2.1) as the client version.

  • Zero as the settings flag.

  • A Unicode string containing the FQDN of the DNS server on which the zone is to be created.

  • "example.com" as the zone name.

  • Zero as the context.

  • DeleteZonescope as the operation.

  • DNSSRV_TYPEID_LPWSTR as the type ID.

  • Create a Unicode string "example_americas" and pass this as RPC Data.

The DNS server returns ERROR_SUCCESS if the operation was successful or a Windows error code if the operation failed.