DNS TXT Record Escaping Issue - Affecting Service

Hi Cloudflare Support/Community,

We're experiencing an issue with DNS TXT record retrieval that's impacting our service. We have a TXT record for
endpoints.adm.allxon.com
containing a JSON string for API endpoint information.
Here's the original format of the JSON within the TXT record:

"api-v1={\"region\":\"GLOBAL\",\"endpoints\":{\"API\":[\"api.adm-dev.allxon.com\"]}}"


We use a DoH to get this data. Up until recently, this was working fine. However, the response format has changed.

Here's the current response from Cloudflare's DoH service:
{
    // ... other fields
    "Answer": [
        {
            // ... other fields
            "data": "\"api-v1={\\\"region\\\":\\\"GLOBAL\\\",\\\"endpoints\\\":{\\\"API\\\":[\\\"api.adm.allxon.com\\\"]}}\""
        }
    ]
}


And here's what a previous, correct response (from our logs) looked like:

{
    // ... other fields
    "Answer": [
        {
            // ... other fields
            "data": "\"api-v1={\"region\":\"GLOBAL\",\"endpoints\":{\"API\":[\"api.adm-dev.allxon.com\"]}}\""
        }
    ]
}


For comparison, We also tried Google's DoH (
dns.google
) returns the correct (original) format:

The crucial difference is the escaping within the
data
field. Previously, single backslashes (
\
) were used to escape the inner double quotes in the JSON. Now, Cloudflare's DNS is returning triple backslashes (
\\\
).

Our code expects the original single backslash escaping and can't parse the JSON with the triple backslashes.
We'd really appreciate🙏 it if you could revert to the previous single backslash escaping. Let me know if you need any further information.

Thanks in advance for your help!
Was this page helpful?