[metadata]
algolia_content_type: Reference
algolia_product_filter: 1.1.1.1 (DNS Resolver)
description: Query 1.1.1.1 DNS over HTTPS using JSON format.
generator: Astro v7.2.0
generator: Nimbus v0.2.2
image: https://developers.cloudflare.com/og-docs.png
og:description: Query 1.1.1.1 DNS over HTTPS using JSON format.
og:image: https://developers.cloudflare.com/og-docs.png
og:locale: en
og:site_name: Cloudflare Docs
og:title: Using JSON
og:title: Using JSON · Cloudflare 1.1.1.1 docs
og:type: article
og:url: https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/
pcx_additional_products: 1.1.1.1
pcx_content_group: Consumer services
pcx_content_type: Reference
pcx_last_modified: 107
pcx_product: 1.1.1.1 (DNS Resolver)
twitter:card: summary_large_image
twitter:image: https://developers.cloudflare.com/og-docs.png
twitter:site: @cloudflare
viewport: width=device-width, initial-scale=1

[canonical-links]
https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/

[document-links]
/
1.1.1.1 (DNS Resolver): /1.1.1.1/
1.1.1.1 Public DNS Resolver: /1.1.1.1/privacy/public-dns-resolver/
1.1.1.1 llms-full.txt ↗: /1.1.1.1/llms-full.txt
1.1.1.1 llms.txt ↗: /1.1.1.1/llms.txt
AI Security: https://www.cloudflare.com/solutions/ai-security/
API: /api/
About DoH: /1.1.1.1/encryption/dns-over-https/
About: https://www.cloudflare.com/about/
Agent setup ↗: /agent-setup/
Agent setup: /agent-setup/
Android: /1.1.1.1/setup/android/
App innovation report: https://www.cloudflare.com/resource/app-innovation-report/
Athenian Project: https://www.cloudflare.com/athenian/
Azure: /1.1.1.1/setup/azure/
Blog: https://blog.cloudflare.com/
Careers: https://www.cloudflare.com/careers/
Case studies: https://www.cloudflare.com/case-studies/
Changelog: /1.1.1.1/changelog/
Changelog: /changelog/
Cloudflare AI Cloud: https://www.cloudflare.com/solutions/ai/
Cloudflare Docs llms-full.txt ↗: /llms-full.txt
Cloudflare Docs llms.txt ↗: /llms.txt
Cloudflare Radar: https://radar.cloudflare.com/
Cloudflare Resolver for Firefox: /1.1.1.1/privacy/cloudflare-resolver-firefox/
Cloudflare Skills ↗: https://github.com/cloudflare/skills
Cloudflare for Campaigns: https://www.cloudflare.com/campaigns/
Code Mode MCP Server ↗: https://github.com/cloudflare/mcp
Community: https://community.cloudflare.com/
Compliance resources: https://www.cloudflare.com/trust-hub/compliance-resources/
Configure DoH on your browser: /1.1.1.1/encryption/dns-over-https/encrypted-dns-browsers/
Connect to 1.1.1.1 using DoH clients: /1.1.1.1/encryption/dns-over-https/dns-over-https-client/
Contact sales: https://www.cloudflare.com/resource/contact-enterprise-sales/
DNS Wireformat: /1.1.1.1/encryption/dns-over-https/make-api-requests/dns-wireformat/
DNS in Google Sheets: /1.1.1.1/additional-options/dns-in-google-sheets/
DNS over Discord: /1.1.1.1/additional-options/dns-over-discord/
DNS over HTTPS wireformat: /1.1.1.1/encryption/dns-over-https/make-api-requests/dns-wireformat/
DNS over HTTPS: /1.1.1.1/encryption/dns-over-https/
DNS over TLS: /1.1.1.1/encryption/dns-over-tls/
DNS over Tor: /1.1.1.1/additional-options/dns-over-tor/
DNSKEY: /1.1.1.1/encryption/dnskey/
Data Protection: https://www.cloudflare.com/trust-hub/gdpr/
Directory: /directory/
Docs: /
Documentation: https://developers.cloudflare.com/
Domain name search: https://domains.cloudflare.com/
Domain-specific MCP Servers ↗ MCP: https://github.com/cloudflare/mcp-server-cloudflare
Edit page: https://github.com/cloudflare/cloudflare-docs/edit/production/src/content/docs/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json.mdx
Encryption: /1.1.1.1/encryption/
Events: https://www.cloudflare.com/events/
Extended DNS error codes: /1.1.1.1/infrastructure/extended-dns-error-codes/
FAQ: /1.1.1.1/faq/
Find a partner: https://partnerlocator.cloudflare.com/dashboard
Frontend Development Platform: https://www.cloudflare.com/solutions/frontends/
Gaming consoles: /1.1.1.1/setup/gaming-consoles/
General: /1.1.1.1/setup/
Global network: https://www.cloudflare.com/network/
Google Cloud: /1.1.1.1/setup/google-cloud/
Home: /
IP addresses: /1.1.1.1/ip-addresses/
Impact/ESG: https://www.cloudflare.com/impact/
Investors: https://cloudflare.net/
Learning center: https://www.cloudflare.com/learning/
Linux: /1.1.1.1/setup/linux/
Log In: https://dash.cloudflare.com/login
Log in Dashboard: https://dash.cloudflare.com/
Make API requests to 1.1.1.1: /1.1.1.1/encryption/dns-over-https/make-api-requests/
Multi-Tenant Platform Development: https://www.cloudflare.com/solutions/platforms/
Network operators: /1.1.1.1/infrastructure/network-operators/
Next Configure DoH on your browser: /1.1.1.1/encryption/dns-over-https/encrypted-dns-browsers/
Oblivious DoH: /1.1.1.1/encryption/oblivious-dns-over-https/
Overview: /1.1.1.1
Overview: /1.1.1.1/encryption/
Overview: /1.1.1.1/encryption/dns-over-https/make-api-requests/
Overview: /1.1.1.1/privacy/
Partners: https://www.cloudflare.com/partners/
Plans: https://www.cloudflare.com/plans/
Press kit: https://www.cloudflare.com/press/press-kit/
Press: https://www.cloudflare.com/press/
Previous DNS Wireformat: /1.1.1.1/encryption/dns-over-https/make-api-requests/dns-wireformat/
Privacy policy: https://www.cloudflare.com/policies/privacy/
Project Fairshot: https://www.cloudflare.com/fair-shot/
Project Galileo: https://www.cloudflare.com/galileo/
RFC 1035 ↗: https://www.rfc-editor.org/rfc/rfc1035.html
Report abuse: https://www.cloudflare.com/trust-hub/abuse-approach/
Report issue: https://github.com/cloudflare/cloudflare-docs/issues/new/choose
Report security issues: https://www.cloudflare.com/disclosure/
Responsible AI: https://www.cloudflare.com/trust-hub/responsible-ai/
Router: /1.1.1.1/setup/router/
SDKs: /fundamentals/api/reference/sdks/
SLA and support: /1.1.1.1/infrastructure/sla-and-support/
SSE and SASE platform: https://www.cloudflare.com/sase/
Start Building: https://dash.cloudflare.com/sign-up
Startups: https://www.cloudflare.com/startups/
Status: https://www.cloudflarestatus.com/
Support for IPv6-only networks: /1.1.1.1/infrastructure/ipv6-networks/
Support: https://support.cloudflare.com/
Terms of use: /1.1.1.1/terms-of-use/
Terms of use: https://www.cloudflare.com/policies/terms/
Trademark: https://www.cloudflare.com/trademark/
Transparency report: https://www.cloudflare.com/transparency/
Troubleshooting: /1.1.1.1/troubleshooting/
Trust Hub: https://www.cloudflare.com/trust-hub/
Under attack?: https://www.cloudflare.com/under-attack-hotline/
Upstream resolution: /1.1.1.1/upstream-resolution/
Using JSON: /1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/
Verify connection: /1.1.1.1/check/
View as Markdown: index.md
Web Security Platform: https://www.cloudflare.com/solutions/security/
Windows: /1.1.1.1/setup/windows/
https://github.com/cloudflare/cloudflare-docs
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4 ↗: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6 ↗: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6
iOS: /1.1.1.1/setup/ios/
macOS: /1.1.1.1/setup/macos/
numeric value or text ↗: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4

[structured-data]
{"@context":"https://schema.org","@id":"https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/#page","@type":"TechArticle","dateModified":"2026-05-05","description":"Query 1.1.1.1 DNS over HTTPS using JSON format.","headline":"Using JSON · Cloudflare 1.1.1.1 docs","image":"https://developers.cloudflare.com/og-docs.png","inLanguage":"en","isPartOf":{"@id":"https://developers.cloudflare.com/#website","@type":"WebSite","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"publisher":{"@type":"Organization","name":"Cloudflare","url":"https://www.cloudflare.com/"},"url":"https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/"}

[content]
Using JSON · Cloudflare 1.1.1.1 docs
Skip to content
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/1.1.1.1/llms.txt
Use this file to discover all available pages before exploring further.
Docs
Directory
API
SDKs
Changelog
Search
Ctrl
K
Log in
Dashboard
1.1.1.1 (DNS Resolver)
/
Overview
IP addresses
Set up
General
Android
Azure
Gaming consoles
Google Cloud
iOS
Linux
macOS
Router
Windows
Encryption
Overview
DNS over TLS
DNS over HTTPS
About DoH
Make API requests to 1.1.1.1
Overview
DNS Wireformat
Using JSON
Configure DoH on your browser
Connect to 1.1.1.1 using DoH clients
Oblivious DoH
DNSKEY
Upstream resolution
Infrastructure
Network operators
Support for IPv6-only networks
Extended DNS error codes
SLA and support
Other ways to use 1.1.1.1
DNS in Google Sheets
DNS over Discord
DNS over Tor
Privacy
Overview
1.1.1.1 Public DNS Resolver
Cloudflare Resolver for Firefox
Verify connection
Troubleshooting
Terms of use
FAQ
Changelog
Agent resources
Agent setup ↗
Cloudflare Skills ↗
Code Mode MCP Server ↗
Domain-specific MCP Servers ↗
MCP
1.1.1.1 llms.txt ↗
1.1.1.1 llms-full.txt ↗
Cloudflare Docs llms.txt ↗
Cloudflare Docs llms-full.txt ↗
Home
/
1.1.1.1 (DNS Resolver)
/
…
Encryption
DNS over HTTPS
/
Make API requests to 1.1.1.1
/
Using JSON
Using JSON
Last updated
May 5, 2026
|
Copy as Markdown
|
View as Markdown
|
Agent setup
Overview
Supported parameters
Examples
Response fields
Successful response
Error response
Caution
The DNS over HTTPS JSON format does not have a formal RFC, which means behavior might be different between providers. Additionally, there might be small changes in behavior in the future.
For critical use cases, it is recommended to use the
DNS over HTTPS wireformat
, which is defined in
RFC 1035
↗
.
Cloudflare's DNS over HTTPS endpoint also supports JSON format for querying DNS data. There is no agreed-upon JSON schema for DNS over HTTPS in the Internet Engineering Task Force (IETF), so Cloudflare has chosen to follow the same schema as Google's DNS over HTTPS resolver.
JSON formatted queries are sent using a
GET
request. When making requests using
GET
, the DNS query is encoded into the URL. Include an HTTP
Accept
request header with a MIME type of
application/dns-json
to indicate that the client can accept a JSON response.
Supported parameters
Field
Required?
Description
Default
name
Yes
Query name.
-
type
No
Query type (either a
numeric value or text
↗
).
A
do
No
DO
bit - whether the client wants DNSSEC data (either empty or one of
0
,
false
,
1
, or
true
).
false
cd
No
CD
bit - disable validation (either empty or one of
0
,
false
,
1
, or
true
).
false
Examples
Example request and response:
curl
--header
"accept: application/dns-json"
"https://cloudflare-dns.com/dns-query?name=example.com&type=AAAA"
{
"Status"
:
0
,
"TC"
:
false
,
"RD"
:
true
,
"RA"
:
true
,
"AD"
:
true
,
"CD"
:
false
,
"Question"
: [
{
"name"
:
"example.com."
,
"type"
:
28
}
],
"Answer"
: [
{
"name"
:
"example.com."
,
"type"
:
28
,
"TTL"
:
1726
,
"data"
:
"2606:2800:220:1:248:1893:25c8:1946"
}
]
}
In the case of an invalid request a
400 Bad Request
error is returned:
curl
--header
"accept: application/dns-json"
"https://cloudflare-dns.com/dns-query?name=example.com&cd=2"
{
"error"
:
"Invalid CD flag `2`. Expected to be empty or one of `0`, `false`, `1`, or `true`."
}
Response fields
The following tables have more information on each response field.
Successful response
Field
Description
Status
The Response Code of the DNS Query. The codes are defined here:
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6
↗
.
TC
If the
TC
field is true, the truncated bit was set. This occurs when the DNS answer exceeds the size of a single UDP or TCP packet. With Cloudflare DNS over HTTPS, the
TC
field is almost always false because Cloudflare supports the maximum response size.
RD
If true, it means the Recursive Desired bit was set. This is always set to true for Cloudflare DNS over HTTPS.
RA
If true, it means the Recursion Available bit was set. This is always set to true for Cloudflare DNS over HTTPS.
AD
If true, it means that every record in the answer was verified with DNSSEC.
CD
If true, the client asked to disable DNSSEC validation. In this case, Cloudflare will still fetch the DNSSEC-related records, but it will not attempt to validate the records.
Question: name
The record name requested.
Question: type
The type of DNS record requested. These are defined here:
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
↗
.
Answer: name
The record owner.
Answer: type
The type of DNS record. These are defined here:
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
↗
.
Answer: TTL
The number of seconds the answer can be stored in cache before it is considered stale.
Answer: data
The value of the DNS record for the given name and type. The data will be in text for standardized record types and in hex for unknown types.
Authority: name
The record owner.
Authority: type
The type of DNS record. These are defined here:
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
↗
.
Authority: TTL
The number of seconds the answer can be stored in cache before it is considered stale.
Authority: data
The value of the DNS record for the given name and type. The data will be in text for standardized record types and in hex for unknown types.
Additional: name
The record owner.
Additional: type
The type of DNS record. These are defined here:
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
↗
.
Additional: TTL
The number of seconds the answer can be stored in cache before it is considered stale.
Additional: data
The value of the DNS record for the given name and type. The data will be in text for standardized record types and in hex for unknown types.
Comment
List of EDE messages. Refer to
Extended DNS error codes
for more information.
Error response
Field
Description
error
An explanation of the error that occurred.
Previous
DNS Wireformat
Next
Configure DoH on your browser
Was this helpful?
Yes
No
Edit page
Report issue
On this page
Overview
Supported parameters
Examples
Response fields
Successful response
Error response
Edit page
Report issue
Getting started
Plans
Contact sales
Partners
Find a partner
Startups
Under attack?
Domain name search
Company
About
Careers
Investors
Press
Press kit
Global network
Public interest
Project Galileo
Athenian Project
Cloudflare for Campaigns
Project Fairshot
Impact/ESG
Compliance
Compliance resources
Trust Hub
Data Protection
Responsible AI
Transparency report
Report abuse
Resources
App innovation report
Cloudflare Radar
Case studies
Status
Support
Events
Blog
Developers
Documentation
Learning center
Community
Solutions
SSE and SASE platform
Cloudflare AI Cloud
AI Security
Frontend Development Platform
Multi-Tenant Platform Development
Web Security Platform
Start Building
Log In
© 2026 Cloudflare, Inc.
Privacy policy
|
Report security issues
|
Terms of use
|
Trademark
|
Your privacy choices
Docs
