Searching

The API allows searching for data in Zones, Comments and RRSets.

Note

Not all backends support searching in records or comments.

Endpoints

GET /servers/{server_id}/search-data

Search the data inside PowerDNS

Search the data inside PowerDNS for search_term and return at most max_results. This includes zones, records and comments. The * character can be used in search_term as a wildcard character and the ? character can be used as a wildcard for a single character.

Parameters:
  • server_id (string) – The id of the server to retrieve

Query Parameters:
  • q (string) – The string to search for (Required)

  • max (integer) – Maximum number of entries to return (Required)

  • object_type (string) – Type of data to search for, one of “all”, “zone”, “record”, “comment”

Example request:

GET /servers/{server_id}/search-data?q=string&max=1 HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Returns a JSON array with results

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "name": "string",
            "object_type": "string",
            "zone_id": "string"
        },
        {
            "content": "string",
            "disabled": true,
            "name": "string",
            "object_type": "string",
            "zone_id": "string",
            "zone": "string",
            "type": "string",
            "ttl": 1
        },
        {
            "content": "string",
            "name": "string",
            "object_type": "string",
            "zone_id": "string",
            "zone": "string",
            "type": "string"
        }
    ]
    

  • default

    The input to the operation was not valid

    Example response:

    HTTP/1.1 default -
    Content-Type: application/json
    
    {
        "error": "string",
        "errors": [
            "string"
        ]
    }
    

Objects

json SearchResult : SearchResultZone | SearchResultRecord | SearchResultComment

SearchResult