API-Dokumentation (mydomain.lu)

API Documentation Overview

The mydomain.lu DNS Management API provides programmatic access to DNS zone management. This includes retrieving DNS zone information, exporting zone files, and adding, updating, or removing DNS records. All modification requests return a processing ticket, as DNS changes are handled asynchronously.
An order is processed sequentially. You must wait for the current order to finish before submitting another one. If you don’t wait, the order will fail. Please allow a few seconds for the order to complete and propagate.


Requirements

  • Be an active mydomain.lu customer.
  • Have a valid account capable of logging into the platform (test via web GUI).
  • Have 2FA disabled. If you want to keep 2FA enabled, ask support(post.lu) to provide you a limited account for API use only.
  • Have adequate API permissions.

Authentication

All API requests require a Basic Auth header:

Authorization: Basic {Base64EncodedCredentials}

Table of Contents





======================================
GET – ZONE INFO
======================================

1. Get Zone Information

GET:
https://api.mydomain.lu/zones/{domain}
Example: https://api.mydomain.lu/zones/example.lu

Parameters

  • Authorization (header)
  • domain (path)

Response 200 OK

{
  "expire": "2026‑03‑23T14:57:43.279Z",
  "creation": "2026‑03‑23T14:57:43.279Z",
  "lastChange": "2026‑03‑23T14:57:43.279Z",
  "domain": "example.lu",
  "contactArray": [...],
  "nameserverArray": [...],
  "resourceRecords": [...],
  "domainStatus": [...]
}

 

2. Get Records in Zone

GET:
https://api.mydomain.lu/zones/{domain}/records
Example: https://api.mydomain.lu/zones/example.lu/records

Response 200 OK

[
  {
    "group": "default",
    "AResourceRecord": [...],
    "CNAMEResourceRecord": [...],
    "TXTResourceRecord": [
      { "name": "example.lu.", "ttl": 0, "active": true, "text": "OtSANXuE" },
      { "name": "example.lu.", "ttl": 0, "active": true, "text": "40plQl4A" },
      { "name": "example.lu.", "ttl": 0, "active": true, "text": "hello 123" },
      { "name": "example.lu.", "ttl": 0, "active": true, "text": "v=spf1 include:spf-strict.hostpack.lu -all" }
    ]
  }
]

 

3. Export Zone

GET:
https://api.mydomain.lu/zones/{domain}/export
Example: https://api.mydomain.lu/zones/example.lu/export

Response 200 OK

example.lu. 172800 IN NS ns1.pt.lu.
example.lu. 172800 IN NS ns3.pt.lu.
example.lu. 172800 IN NS ns2.pt.lu.
example.lu. 3600   IN MX 10 mx.hostpack.lu.
smtp.example.lu. 3600 IN CNAME outgoing.hostpack.lu.
api.example.lu.  300  IN CNAME backend.example.lu.
www.example.lu.  3600 IN A 194.154.192.87
example.lu.      300  IN A 194.154.192.87
example.lu.      300  IN A 127.127.127.127




======================================
PATCH – MODIFY RECORDS
======================================

4. PATCH Add A Record

PATCH:
https://api.mydomain.lu/zones/{domain}/records/add/ARecord
Example: https://api.mydomain.lu/zones/example.lu/records/add/ARecord

Request Body

{
  "name": "example.lu.",
  "ttl": "300",
  "active": "true",
  "hostAddress": "127.127.127.127"
}

Response 200 OK

{
  "code": 1001,
  "message": "Domain Zone Modify - Command completed successfully. Action pending.",
  "ticket": "2603261350443199",
  "infoMsg": [],
  "errorMsg": []
}

 

5. PATCH Remove A Record

PATCH:
https://api.mydomain.lu/zones/{domain}/records/remove/ARecord
Example: https://api.mydomain.lu/zones/example.lu/records/remove/ARecord

Request Body

{
  "name": "example.lu.",
  "ttl": "300",
  "active": "true",
  "hostAddress": "127.127.127.127"
}

Response 200 OK

{
  "code": 1001,
  "message": "Domain Zone Modify - Command completed successfully. Action pending.",
  "ticket": "2603261353158199",
  "infoMsg": [],
  "errorMsg": []
}

 

6. PATCH Add TXT Record

PATCH:
https://api.mydomain.lu/zones/{domain}/records/add/TXTRecord
Example: https://api.mydomain.lu/zones/example.lu/records/add/TXTRecord

Request Body

{
  "name": "example.lu.",
  "ttl": "300",
  "active": "true",
  "text": "66iCWhUr"
}

Response 200 OK

{
  "code": 1001,
  "message": "Domain Zone Modify - Command completed successfully. Action pending.",
  "ticket": "2603261345481210",
  "infoMsg": [],
  "errorMsg": []
}

 

7. PATCH Remove TXT Record

PATCH:
https://api.mydomain.lu/zones/{domain}/records/remove/TXTRecord
Example: https://api.mydomain.lu/zones/example.lu/records/remove/TXTRecord

Request Body

{
  "name": "example.lu.",
  "ttl": "300",
  "active": "true",
  "text": "66iCWhUr"
}

Response 200 OK

{
  "code": 1001,
  "message": "Domain Zone Modify - Command completed successfully. Action pending.",
  "ticket": "2603261355413680",
  "infoMsg": [],
  "errorMsg": []
}

 

8. PATCH Add CNAME Record

PATCH:
https://api.mydomain.lu/zones/{domain}/records/add/CNAMERecord
Example: https://api.mydomain.lu/zones/example.lu/records/add/CNAMERecord

Request Body

{
  "name": "api.example.lu.",
  "ttl": "300",
  "active": "true",
  "hostname": "example.lu.copr.lu."
}

Response 200 OK

{
  "code": 1001,
  "message": "Domain Zone Modify - Command completed successfully. Action pending.",
  "ticket": "2603261400502312",
  "infoMsg": [],
  "errorMsg": []
}

 

9. Remove CNAME Record

PATCH:
https://api.mydomain.lu/zones/{domain}/records/remove/CNAMERecord
Example: https://api.mydomain.lu/zones/example.lu/records/remove/CNAMERecord

Request Body

{
  "name": "api.example.lu.",
  "ttl": "300",
  "active": "true",
  "hostname": "example.lu.copr.lu."
}

Response 200 OK

{
  "code": 1001,
  "message": "Domain Zone Modify - Command completed successfully. Action pending.",
  "ticket": "2603261400502312",
  "infoMsg": [],
  "errorMsg": []
}