Skip to main content

PiHole v6

This Integration is part of the PiHole Pack.#

PiHole v6 integration using the new REST API. PiHole is a network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole and optionally a DHCP server, intended for use on a private network. This integration was integrated and tested with PiHole v6.0 API.

Configure PiHole v6 in Cortex#

ParameterDescriptionRequired
urlServer URL (e.g. https://192.168.1.25\)True
passwordPiHole admin password for API authenticationTrue
insecureTrust any certificate (not secure)False
proxyUse system proxy settingsFalse

Commands#

You can execute these commands from the CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

pihole-get-summary#


Get overview of PiHole activity including query stats, client counts, and gravity info.

Base Command#

pihole-get-summary

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.Summary.queriesUnknownQuery statistics including total, blocked, cached, forwarded counts.
PiHoleV6.Summary.clientsUnknownClient statistics.
PiHoleV6.Summary.gravityUnknownGravity list statistics.

pihole-get-top-domains#


Get top permitted or blocked domains.

Base Command#

pihole-get-top-domains

Input#

Argument NameDescriptionRequired
countNumber of top domains to return. Default is 10.Optional
blockedIf true, return top blocked domains instead of top permitted domains. Possible values are: true, false. Default is false.Optional

Context Output#

PathTypeDescription
PiHoleV6.TopDomains.domainsUnknownArray of top domains with counts.
PiHoleV6.TopDomains.total_queriesNumberTotal number of queries.

pihole-get-top-clients#


Get top clients by query count.

Base Command#

pihole-get-top-clients

Input#

Argument NameDescriptionRequired
countNumber of top clients to return. Default is 10.Optional
blockedIf true, return top blocked clients instead of top active clients. Possible values are: true, false. Default is false.Optional

Context Output#

PathTypeDescription
PiHoleV6.TopClients.clientsUnknownArray of top clients with counts.
PiHoleV6.TopClients.total_queriesNumberTotal number of queries.

pihole-get-upstreams#


Get metrics about upstream DNS destinations.

Base Command#

pihole-get-upstreams

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.Upstreams.upstreamsUnknownArray of upstream destinations with query counts and response times.
PiHoleV6.Upstreams.forwarded_queriesNumberNumber of forwarded queries.

pihole-get-query-types#


Get breakdown of DNS query types.

Base Command#

pihole-get-query-types

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.QueryTypes.typesUnknownQuery type counts (A, AAAA, MX, etc).

pihole-get-recent-blocked#


Get most recently blocked domain(s).

Base Command#

pihole-get-recent-blocked

Input#

Argument NameDescriptionRequired
countNumber of recently blocked domains to return. Default is 1.Optional

Context Output#

PathTypeDescription
PiHoleV6.RecentBlocked.blockedUnknownList of recently blocked domains.

pihole-get-history#


Get activity graph data (queries over time).

Base Command#

pihole-get-history

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.History.historyUnknownActivity over time data with timestamps, total, cached, blocked, forwarded counts.

pihole-get-history-clients#


Get per-client activity graph data.

Base Command#

pihole-get-history-clients

Input#

Argument NameDescriptionRequired
NMaximum number of clients to return. 0 returns all. Default is 20.Optional

Context Output#

PathTypeDescription
PiHoleV6.HistoryClients.clientsUnknownClient information with query counts.
PiHoleV6.HistoryClients.historyUnknownPer-client activity over time.

pihole-get-queries#


Get DNS query log with optional filtering.

Base Command#

pihole-get-queries

Input#

Argument NameDescriptionRequired
lengthNumber of queries to return. Default is 100.Optional
domainFilter by domain (wildcards supported).Optional
client_ipFilter by client IP (wildcards supported).Optional
client_nameFilter by client hostname (wildcards supported).Optional
upstreamFilter by upstream server.Optional
typeFilter by query type (A, AAAA, etc).Optional
statusFilter by status (GRAVITY, FORWARDED, CACHE, etc).Optional

Context Output#

PathTypeDescription
PiHoleV6.Queries.queriesUnknownArray of DNS query records.
PiHoleV6.Queries.recordsTotalNumberTotal number of available queries.

pihole-get-blocking-status#


Get current PiHole blocking status.

Base Command#

pihole-get-blocking-status

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.Blocking.blockingStringCurrent blocking status (enabled/disabled).
PiHoleV6.Blocking.timerNumberRemaining seconds until blocking mode changes automatically. Null if permanent.

pihole-set-blocking#


Enable or disable PiHole blocking, optionally with a timer.

Base Command#

pihole-set-blocking

Input#

Argument NameDescriptionRequired
blockingEnable or disable blocking. Possible values are: true, false.Required
timerSeconds until blocking mode automatically reverts. Leave empty for permanent change.Optional

Context Output#

PathTypeDescription
PiHoleV6.Blocking.blockingStringNew blocking status.
PiHoleV6.Blocking.timerNumberTimer value if set.

pihole-get-domains#


Get domains from allow/deny lists. Filter by type and kind.

Base Command#

pihole-get-domains

Input#

Argument NameDescriptionRequired
typeDomain type filter. Possible values are: allow, deny.Optional
kindDomain kind filter. Possible values are: exact, regex.Optional

Context Output#

PathTypeDescription
PiHoleV6.Domains.domainsUnknownArray of domain entries.

pihole-add-domain#


Add a domain to allow/deny list.

Base Command#

pihole-add-domain

Input#

Argument NameDescriptionRequired
typeDomain type. Possible values are: allow, deny.Required
kindDomain kind. Possible values are: exact, regex.Required
domainDomain to add.Required
commentOptional comment.Optional

Context Output#

PathTypeDescription
PiHoleV6.Domains.domainsUnknownAdded domain details.

pihole-delete-domain#


Delete a domain from allow/deny list.

Base Command#

pihole-delete-domain

Input#

Argument NameDescriptionRequired
typeDomain type. Possible values are: allow, deny.Required
kindDomain kind. Possible values are: exact, regex.Required
domainDomain to delete.Required

Context Output#

There is no context output for this command.

pihole-get-version#


Get PiHole component versions.

Base Command#

pihole-get-version

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.VersionUnknownVersion information for all PiHole components.

pihole-get-system-info#


Get system information from PiHole host.

Base Command#

pihole-get-system-info

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.SystemInfoUnknownSystem information (CPU, memory, disk, uptime, etc).

pihole-get-ftl-info#


Get FTL (Faster Than Light) engine information.

Base Command#

pihole-get-ftl-info

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.FTLInfoUnknownFTL engine information.

pihole-get-host-info#


Get host information.

Base Command#

pihole-get-host-info

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.HostInfoUnknownHost information.

pihole-get-sensors#


Get sensor information from PiHole host.

Base Command#

pihole-get-sensors

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.SensorsUnknownSensor readings (temperature, etc).

pihole-run-gravity#


Update PiHole gravity (pull latest adlists).

Base Command#

pihole-run-gravity

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.Gravity.outputStringGravity update output.

pihole-restart-dns#


Restart the pihole-FTL DNS service.

Base Command#

pihole-restart-dns

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.RestartDNSUnknownRestart result.

pihole-flush-logs#


Flush DNS logs and purge last 24 hours from database.

Base Command#

pihole-flush-logs

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.FlushLogsUnknownFlush result.

pihole-flush-network#


Flush the network table (remove all known devices and addresses).

Base Command#

pihole-flush-network

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.FlushNetworkUnknownFlush result.

pihole-get-network-devices#


Get network devices known to PiHole.

Base Command#

pihole-get-network-devices

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.NetworkDevicesUnknownNetwork device information.

pihole-get-network-gateway#


Get network gateway information.

Base Command#

pihole-get-network-gateway

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.GatewayUnknownGateway information.

pihole-search-domain#


Search for a domain across all PiHole lists and configuration.

Base Command#

pihole-search-domain

Input#

Argument NameDescriptionRequired
domainDomain to search for.Required

Context Output#

PathTypeDescription
PiHoleV6.SearchUnknownSearch results showing where the domain appears in PiHole configuration.

pihole-get-dhcp-leases#


Get current DHCP leases.

Base Command#

pihole-get-dhcp-leases

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.DHCPLeasesUnknownDHCP lease information.

pihole-get-groups#


Get all groups.

Base Command#

pihole-get-groups

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.GroupsUnknownGroup information.

pihole-add-group#


Create a new group.

Base Command#

pihole-add-group

Input#

Argument NameDescriptionRequired
nameGroup name.Required
commentOptional comment.Optional

Context Output#

PathTypeDescription
PiHoleV6.GroupsUnknownCreated group details.

pihole-delete-group#


Delete a group.

Base Command#

pihole-delete-group

Input#

Argument NameDescriptionRequired
nameGroup name to delete.Required

Context Output#

There is no context output for this command.

pihole-get-lists#


Get all configured adlists.

Base Command#

pihole-get-lists

Input#

Argument NameDescriptionRequired

Context Output#

PathTypeDescription
PiHoleV6.ListsUnknownAdlist information.

pihole-add-list#


Add a new adlist.

Base Command#

pihole-add-list

Input#

Argument NameDescriptionRequired
addressURL of the adlist to add.Required
commentOptional comment.Optional
enabledWhether the list should be enabled. Possible values are: true, false. Default is true.Optional

Context Output#

PathTypeDescription
PiHoleV6.ListsUnknownAdded list details.

pihole-delete-list#


Delete an adlist.

Base Command#

pihole-delete-list

Input#

Argument NameDescriptionRequired
addressURL of the adlist to delete.Required

Context Output#

There is no context output for this command.