curl --get "https://api.nextdns.io/profiles/$PROFILE_ID/logs" \
--header "X-Api-Key: $NEXTDNS_API_KEY" \
--data-urlencode 'from=-6h' \
--data-urlencode 'status=blocked'
{
"data": [
{
"timestamp": "2026-11-30T10:15:24.068Z",
"domain": "ads.example.com",
"root": "example.com",
"encrypted": true,
"protocol": "DNS-over-HTTPS",
"status": "blocked",
"reasons": [
{ "id": "denylist", "name": "Denylist" }
]
}
],
"meta": {
"pagination": { "cursor": null },
"stream": { "id": "64vkjdhg6ctkechm60v3g" }
}
}
Logs
List logs
Read a profile’s DNS query history and filter it by time, device, domain, or status.
GET
/
profiles
/
{profile}
/
logs
curl --get "https://api.nextdns.io/profiles/$PROFILE_ID/logs" \
--header "X-Api-Key: $NEXTDNS_API_KEY" \
--data-urlencode 'from=-6h' \
--data-urlencode 'status=blocked'
{
"data": [
{
"timestamp": "2026-11-30T10:15:24.068Z",
"domain": "ads.example.com",
"root": "example.com",
"encrypted": true,
"protocol": "DNS-over-HTTPS",
"status": "blocked",
"reasons": [
{ "id": "denylist", "name": "Denylist" }
]
}
],
"meta": {
"pagination": { "cursor": null },
"stream": { "id": "64vkjdhg6ctkechm60v3g" }
}
}
Read recent DNS activity, newest first. Use
A nonempty first page in descending order also includes
raw=1 to see individual queries across all recorded types. To follow new queries as they arrive, stream logs. For a full export, download a CSV.
Query parameters
Start of the time range, inclusive. For example,
-6h selects the last six hours. If you log queries without domain names, use raw=1 for exact time boundaries. See Dates and time zones for supported formats.Include queries earlier than this time. Use a fixed end time to page through a historical range.
Pass the previous response’s
meta.pagination.cursor to continue with the same filters and sort order.Filter by the
device.id in a log entry. Use __UNIDENTIFIED__ to select queries from unidentified devices.Match a case-sensitive substring of the recorded domain. For example,
example matches both api.example.com and myexample.org.Language for the display names in
reasons, such as fr. Use the reason’s id to identify it across languages.Set to
1 or true to see all recorded queries. The default view includes A, AAAA, HTTPS, and entries whose type was omitted for privacy. It hides background lookups such as health checks and groups repeat lookups of the same domain within five seconds, by device ID or client IP when available.Log entries
Thedata array contains one object per entry. A profile’s logging settings determine which details are available.
| Field | Meaning |
|---|---|
timestamp | When NextDNS recorded the query, in UTC. |
domain, root | The requested domain and its root domain, when recorded. |
status, reasons | How NextDNS handled the query. Each reason contains an id and a display name. The array can be empty. |
matched, tracker | The domain that matched a rule and the recognized tracker identifier, when available. |
protocol, encrypted | The DNS transport and whether it was encrypted. |
clientIp, client | The client’s public IP address and DNS client identifier, when available. |
device | For an identified device, its id and any available name, model, and localIp. |
type, dnssec | In raw mode, the recorded DNS record type when available and a boolean indicating whether NextDNS recorded a DNSSEC-authenticated response. |
meta.stream.id when you omit to. Use it to stream subsequent entries. For another page of history, use the pagination cursor.
When reading raw queries oldest first, set to to a fixed time in the past for a finite export. With an open-ended range, a request can return an empty page and repeat your cursor while it waits for newer entries.
curl --get "https://api.nextdns.io/profiles/$PROFILE_ID/logs" \
--header "X-Api-Key: $NEXTDNS_API_KEY" \
--data-urlencode 'from=-6h' \
--data-urlencode 'status=blocked'
{
"data": [
{
"timestamp": "2026-11-30T10:15:24.068Z",
"domain": "ads.example.com",
"root": "example.com",
"encrypted": true,
"protocol": "DNS-over-HTTPS",
"status": "blocked",
"reasons": [
{ "id": "denylist", "name": "Denylist" }
]
}
],
"meta": {
"pagination": { "cursor": null },
"stream": { "id": "64vkjdhg6ctkechm60v3g" }
}
}