Pi-hole DNS API

DNS blocking configuration.

GitHub OpenAPI

Operations 1

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/dns/blocking Check whether DNS blocking is on · Get current DNS blocking status #
Ask an LLM
“Is Pi-hole currently blocking ads and trackers?”
“What is the current DNS blocking status?”
Tell an agent
Show the DNS blocking status.
Check whether ad blocking is enabled.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pi-hole:pi-hole-dns-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

pi-hole-dns-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Pi-hole REST DNS API
  description: 'REST API exposed by the pihole-FTL binary (v6+) for managing DNS

    blocklists, allowlists, groups, clients, configuration, and query logs

    on a Pi-hole instance.'
  version: 6.0.0
  contact:
    name: Pi-hole documentation
    url: https://docs.pi-hole.net/api/
  license:
    name: EUPL-1.2
    url: https://opensource.org/license/eupl-1-2/
servers:
- url: http://{piHoleHost}
  description: Local Pi-hole instance.
  variables:
    piHoleHost:
      default: pi.hole
      description: Hostname or IP of the Pi-hole server.
security:
- sidHeader: []
tags:
- name: DNS
  description: DNS blocking configuration.
paths:
  /api/dns/blocking:
    get:
      tags:
      - DNS
      summary: Get current DNS blocking status
      operationId: getDnsBlockingStatus
      responses:
        '200':
          description: Current DNS blocking status.
          content:
            application/json:
              schema:
                type: object
                properties:
                  blocking:
                    type: string
                    enum:
                    - enabled
                    - disabled
                  timer:
                    type: integer
                    nullable: true
components:
  securitySchemes:
    sidHeader:
      type: apiKey
      in: header
      name: X-FTL-SID
      description: Session identifier returned by POST /api/auth.
externalDocs:
  description: Pi-hole API documentation
  url: https://docs.pi-hole.net/api/