Skip to content
Start here

Get Passive DNS by IP

client.Intel.DNS.List(ctx, params) (*V4PagePagination[DNS], error)
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
params DNSListParams
AccountID param.Field[string]

Path param: Identifier.

maxLength32
IPV4 param.Field[string]optional

Query param

Page param.Field[float64]optional

Query param: Requested page within paginated list of results.

PerPage param.Field[float64]optional

Query param: Maximum number of results requested.

StartEndParams param.Field[DNSListParamsStartEndParams]optional

Query param

End Timeoptional

Defaults to the current date.

formatdate
Start Timeoptional

Defaults to 30 days before the end parameter value.

formatdate
ReturnsExpand Collapse
type DNS struct{…}
Count float64optional

Total results returned based on your search parameters.

Page float64optional

Current page within paginated list of results.

PerPage float64optional

Number of results per page of results.

ReverseRecords []DNSReverseRecordoptional

Reverse DNS look-ups observed during the time period.

FirstSeen Timeoptional

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

formatdate
Hostname stringoptional

Hostname that the IP was observed resolving to.

LastSeen Timeoptional

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

formatdate

Get Passive DNS by IP

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/intel"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Intel.DNS.List(context.TODO(), intel.DNSListParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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
  }
}