---
title: "Create DNS zone"
method: GET
path: "/adddns"
tags: ["DNS", "DNS Zones"]
---

# Create DNS zone

`GET /adddns`

This function creates a DNS zone. If `trueowner=user`, this function does the following:
* Adds a DNS entry in the `/var/cpanel/users/USER` file, where `USER` represents the `trueowner` parameter's value.
* Creates the `/etc/vdomainaliases/DOMAIN` file, where `DOMAIN` represents the new zone's domain.
* Creates the `/etc/vfilters/DOMAIN` file, where `DOMAIN` represents the new zone's domain.

When you call this function, the system uses the domain name and IP address that you supply. WHM's standard zone template determines all other zone information.

This function generates the DNS zone's [MX record](https://en.wikipedia.org/wiki/MX_record), [domain PTR](https://en.wikipedia.org/wiki/Reverse_DNS_lookup#Multiple_pointer_records), and [A records](https://en.wikipedia.org/wiki/List_of_DNS_record_types#A) automatically.

**Important:**

When you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function.

**NOTE:**

You **cannot** use this function to add temporary domains.

## Query parameters

- `domain` string, domain, required
- `ip` string, ipv4, required
- `ipv6` string, ipv6, nullable
- `template` string
- `trueowner` string, username, nullable

## Response `200`

HTTP Request was successful.

- object
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds.
    - `result` 0 | 1 — * `1` - Success. * `0` - Failed. Check the `reason` field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
