Skip to content
Start here

Get Passive DNS by IP

intel.dns.list(DNSListParams**kwargs) -> SyncV4PagePagination[Optional[DNS]]
GET/accounts/{account_id}/intel/dns

Gets a list of all the domains that have resolved to a specific IP address.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Intel WriteIntel Read
ParametersExpand Collapse
account_id: str

Identifier.

maxLength32
ipv4: Optional[str]
page: Optional[float]

Requested page within paginated list of results.

per_page: Optional[float]

Maximum number of results requested.

start_end_params: Optional[StartEndParams]
end: Optional[Union[null, null]]

Defaults to the current date.

formatdate
start: Optional[Union[null, null]]

Defaults to 30 days before the end parameter value.

formatdate
ReturnsExpand Collapse
class DNS:
count: Optional[float]

Total results returned based on your search parameters.

page: Optional[float]

Current page within paginated list of results.

per_page: Optional[float]

Number of results per page of results.

reverse_records: Optional[List[ReverseRecord]]

Reverse DNS look-ups observed during the time period.

first_seen: Optional[date]

First seen date of the DNS record during the time period.

formatdate
hostname: Optional[str]

Hostname that the IP was observed resolving to.

last_seen: Optional[date]

Last seen date of the DNS record during the time period.

formatdate

Get Passive DNS by IP

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
page = client.intel.dns.list(
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
page = page.result.items[0]
print(page.count)
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "reverse_records": [
      {
        "first_seen": "2021-04-01",
        "hostname": "hostname",
        "last_seen": "2021-04-30"
      }
    ]
  },
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "reverse_records": [
      {
        "first_seen": "2021-04-01",
        "hostname": "hostname",
        "last_seen": "2021-04-30"
      }
    ]
  },
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}