Table: cloudflare_dns_record - Query Cloudflare DNS Records using SQL
Cloudflare DNS is a service that provides global, fast, and secure Domain Name System services. It is built on a network that is unified, distributed, and operates in real-time, providing users with reliable and highly available DNS services. It also offers DNSSEC to protect against forged DNS answers and other security threats.
Table Usage Guide
The cloudflare_dns_record
table provides insights into DNS records within Cloudflare. As a network administrator, you can explore record-specific details through this table, including the type of record, associated zone, and configuration settings. Utilize it to uncover information about DNS records, such as those with certain configurations, the zones they are associated with, and their current status.
Important Notes
- You must specify the
zone_id
in thewhere
clause to query this table.
Examples
Query all DNS records for the zone
Explore all DNS records associated with a specific zone to understand its configuration and manage its settings effectively. This can be particularly useful in troubleshooting or optimizing network performance.
select *from cloudflare_dns_recordwhere zone_id = 'ecfee56e04ffb0de172231a027abe23b';
select *from cloudflare_dns_recordwhere zone_id = 'ecfee56e04ffb0de172231a027abe23b';
List MX records in priority order
Determine the areas in which MX records are prioritized within a specific zone in your Cloudflare DNS, providing a clear order of priority. This is useful for managing mail exchange servers and ensuring smooth email delivery.
select name, type, priorityfrom cloudflare_dns_recordwhere zone_id = 'ecfee56e04ffb0de172231a027abe23b' and type = 'MX'order by priority;
select name, type, priorityfrom cloudflare_dns_recordwhere zone_id = 'ecfee56e04ffb0de172231a027abe23b' and type = 'MX'order by priority;
List all records from each zone
Explore which DNS records belong to each zone in your Cloudflare account. This allows you to understand the distribution and organization of your DNS records, aiding in efficient management and troubleshooting.
select r.*, z.name as zonefrom cloudflare_dns_record r, cloudflare_zone zwhere r.zone_id = z.id;
select r.*, z.name as zonefrom cloudflare_dns_record r, cloudflare_zone zwhere r.zone_id = z.id;
Schema for cloudflare_dns_record
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
content | text | Content or value of the record. Changes by type, including IP address for A records and domain for CNAME records. | |
created_on | timestamp with time zone | When the record was created. | |
data | jsonb | Map of attributes that constitute the record value. Primarily used for LOC and SRV record types. | |
id | text | = | ID of the record. |
locked | boolean | True if the record is locked. | |
meta | jsonb | Cloudflare metadata for this record. | |
modified_on | timestamp with time zone | When the record was last modified. | |
name | text | Domain name for the record (e.g. steampipe.io). | |
priority | bigint | Priority for this record, primarily used for MX records. | |
proxiable | boolean | True if the record is eligible for Cloudflare's origin protection. | |
proxied | boolean | True if the record has Cloudflare's origin protection. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
ttl | bigint | Time to live in seconds of the record. | |
type | text | Type of the record (e.g. A, MX, CNAME). | |
user_id | text | =, !=, ~~, ~~*, !~~, !~~* | ID of the current user. |
zone_id | text | = | Zone where the record is defined. |
zone_name | text | Name of the zone where the record is defined. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- cloudflare
You can pass the configuration to the command with the --config
argument:
steampipe_export_cloudflare --config '<your_config>' cloudflare_dns_record