Create a DNS Record

Similar to creating a DNS zone, you need to provide the UUID of the DNS zone to host the new record.

Note: DNS records are further categorized into various record types, each with unique specifications. For more information, see FAQs.

Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.

To create a DNS zone of Type A, follow this step:

  • Perform a POST request with these details:

    • corresponding UUID of the DNS zone,

    • name of the subdomain; example: www

    • record type; in this case: A,

    • content or destination of the A record in the form of an IPv4 address; example: 1.1.1.1

    • TTL you need (minimum 60 seconds and maximum 86.400 seconds), and

    • status of the DNS record (enable), true or false.

Result: On a successful POST request, you receive a response with the DNS record having the UUID assigned.

Info: If you want to create a Wildcard DNS record, you need to provide “*” as the name of your DNS record to match the requests for all non-existent names under your DNS zone name.

Request

curl --location \  
--request POST 'https://dns.de-fra.ionos.com/zones/2a4428b3-dbe0-4357-9c02-609025b3a40f/records' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--header 'Content-Type: application/json' \
--data '{
   "properties": {
    "name": "*",
    "type": "A",
    "content": "172.30.40.50,
    "ttl": 3600,
    "enabled": true
  }

}'

Response

202 Successful operation

{
  "id": "90d81ac0-3a30-44d4-95a5-12959effa6ee",
  "metadata": {
    "lastModifiedDate": "2022-08-21T15:52:53Z",
    "createdDate": "2022-08-21T15:52:53Z",
    "state": "CREATED",
    "fqdn": "*.example.com",
    "zoneId": "2a4428b3-dbe0-4357-9c02-609025b3a40f"
  },
  "properties": {
    "name": "*",
    "type": "A",
    "content": "192.0.2.2",
    "ttl": 3600,
    "enabled": true
  }
}

Response Fields

FieldTypeDescriptionExample

id

string

UUID of the newly created DNS record

90d81ac0-3a30-44d4-95a5-12959effa6ee

createdDate

string

DNS record creation timestamp

2023-03-15T09:58:59.147746133Z

lastModifiedDate

string

DNS record update timestamp

2023-03-15T09:58:59.147746133Z

zoneId

string

UUID of the DNS zone of the DNS record

2a4428b3-dbe0-4357-9c02-609025b3a40f

fqdn

string

Fully qualified domain name resulting from the record name and the zoneName

*.example.com

state

string

State of the request

CREATED

Quota

To retrieve the quota of DNS records, perform a GET request to the /quota endpoint.

Result: On a successful GET request, you receive a response containing the quota limits and quota usage for your contract.

Request

curl --location 'https://dns.de-fra.ionos.com/quota' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--header 'Content-Type: application/json'

Response

200 OK

{
  "quotaLimits": {
    "records": 100000,
    "reverseRecords": 5000,
    "secondaryZones": 100000,
    "zones": 50000
  },
  "quotaUsage": {
    "records": 9,
    "reverseRecords": 1,
    "secondaryZones": 6,
    "zones": 5
  }
}

Response Fields

FieldTypeDescriptionExample

records

string

Number of DNS records

100000

reverseRecords

string

Number of reverse DNS records

5000

secondaryZones

string

Number of secondary DNS zones

100000

zones

string

Number of DNS zones

50000

records

string

Number of DNS records used

9

reverseRecords

string

Number of reverse DNS records used

1

secondaryZones

string

Number of secondary DNS zones used

6

zones

string

Number of DNS zones used

5

Last updated