Page 1 of 1

API PUT /dns/{id} resets DNS zone

Posted: Sun 27. Mar 2022, 04:30
by superrandom
I'm sure the cause of the problem is within KeyHelp
(Problems not related to KeyHelp belong in the Offtopic forum)


Server operating system + version
Debian 10.11

Server virtualization technology used
KVM


KeyHelp version + build number
22.0 - build 2393


Problem description / error messages
When issuing a POST request to /dns/{id} the response seems to match your documentation's success confirmation, returning the same {id} back. However, when I check that the update was made to the dns zone, I find the domain reverts back to defaults, including TTL value.

Expected result
Only the passed record should be updated, and no other changes should be made to the dns zone.

Actual result
DNS zone seems to be reset to defaults, affecting everything about the whole domain, removing records not available by default.

Steps to reproduce
1. Add a record to a dns zone.
2. make a PUT request to /dns/{id} and pass a payload that should update an existing custom (not what keyhelp usually starts with when adding a domain) record.
3. Refresh the admin page for the DNS zone, and observe all custom records are now gone, reverting to a standard domain dns zone, including TTL entries.

Additional information
I cannot find logs about API requests. No php errors noted.

Payload passed:

Code: Select all

{
	"is_dns_disabled": false,
    "records": {
        "other": [
            {
                "host": "office",
                "ttl": 300,
                "type": "A",
                "value": "2.2.2.2"
            },
					            {
                "host": "text",
                "ttl": 300,
                "type": "A",
                "value": "1.1.1.1"
            }
        ]
    }
}

Re: API PUT /dns/{id} resets DNS zone  [SOLVED]

Posted: Sun 27. Mar 2022, 05:20
by 24unix
superrandom wrote: Sun 27. Mar 2022, 04:30 DNS zone seems to be reset to defaults, affecting everything about the whole domain, removing records not available by default.
You have to put the whole zone.


„Attention, when inserting custom DNS records, you have to specify all records not just the one you want to update.“