Table: net_dns_record - Query DNS Records using SQL
DNS service is a scalable, reliable, and managed Domain Name System (DNS) service that provides a high-performance, global footprint for your public-facing internet resources and resolves DNS zones. It enables you to distribute traffic to your endpoints and ensures high availability and failover, thus improving the performance of your web applications.
Table Usage Guide
The net_dns_record
table provides insights into DNS Records. As a network administrator, you can explore DNS record-specific details through this table, including record types, domain names, and associated metadata. Utilize it to uncover information about DNS records, such as those with misconfigured settings, the association between domain names and IP addresses, and the verification of DNS record settings.
Important Notes
The default DNS server used for all requests is the Google global public server, 8.8.8.8. This default can be overriden in 2 ways:
- Update the
dns_server
configuration argument. - Specify
dns_server
in the query, which overrides the default anddns_server
configuration argument. For instance, to use Cloudflare's global public server instead:
select *from net_dns_recordwhere domain = 'steampipe.io' and dns_server = '1.1.1.1:53';
select *from net_dns_recordwhere domain = 'steampipe.io' and dns_server = '1.1.1.1:53';
- A
domain
must be provided in all queries to this table.
Examples
DNS records for a domain
Explore DNS records associated with a specific domain to understand its configuration and structure. This could be beneficial for troubleshooting or auditing purposes.
select *from net_dns_recordwhere domain = 'steampipe.io';
select *from net_dns_recordwhere domain = 'steampipe.io';
List TXT records for a domain
Explore the text records for a specific domain to understand its associated data and time-to-live values. This could be useful for verifying domain ownership or understanding security settings.
select value, ttlfrom net_dns_recordwhere domain = 'github.com' and type = 'TXT';
select value, ttlfrom net_dns_recordwhere domain = 'github.com' and type = 'TXT';
Mail server records for a domain in priority order
Explore the priority order of mail servers for a specific domain. This is beneficial for understanding the order in which email will be delivered or rerouted if the primary server is not available.
select target, priority, ttlfrom net_dns_recordwhere domain = 'turbot.com' and type = 'MX'order by priority;
select target, priority, ttlfrom net_dns_recordwhere domain = 'turbot.com' and type = 'MX'order by priority;
Query examples
Schema for net_dns_record
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
dns_server | text | = | DNS server name and port used for queries. |
domain | text | = | Domain name for the record. |
expire | bigint | Specifies SOA expire value in seconds, which indicates when the zone data is no longer authoritative. | |
ip | inet | IP address for the record, such as for A records. | |
minimum | bigint | Specifies the SOA minimum value in seconds, which indicates how long negative answers are stored in the DNS cache. | |
priority | bigint | Priority of the record, such as for MX records. | |
refresh | bigint | Specifies the SOA refresh interval in seconds, which configures how often a name server should check its primary server to see if there has been any updates to the zone which it does by comparing Serial numbers. | |
retry | bigint | Specifies SOA retry value in seconds, which indicates how long a name server should wait to retry an attempt to get fresh zone data from the primary name server if the first attempt should fail. | |
serial | bigint | Specifies the SOA serial number. | |
tag | text | An ASCII string that represents the identifier of the property represented by the record, such as for CAA records. | |
target | text | Target of the record, such as the target address for CNAME records. | |
ttl | bigint | Time To Live in seconds for the record in DNS cache. | |
type | text | = | Type of the DNS record: A, CNAME, MX, etc. |
value | text | Value of the record, such as the text of a TXT record. |
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)" -- net
You can pass the configuration to the command with the --config
argument:
steampipe_export_net --config '<your_config>' net_dns_record