Skip to content

DNSServer API

Version: 1.0.0

Status: ⚫⚪⚪

DNSServer interface for Thunder framework.

(Defined with IDNSServer in IDNSServer.h)

Table of Contents

Introduction

Scope

This document describes purpose and functionality of the DNSServer interface (version 1.0.0). It includes detailed specification about its methods provided.

Case Sensitivity

All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.

Acronyms, Abbreviations and Terms

The table below provides and overview of acronyms used in this document and their definitions.

Acronym Description
API Application Programming Interface
HTTP Hypertext Transfer Protocol
JSON JavaScript Object Notation; a data interchange format
JSON-RPC A remote procedure call protocol encoded in JSON

The table below provides and overview of terms and abbreviations used in this document and their definitions.

Term Description
callsign The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique.

References

Ref ID Description
HTTP HTTP specification
JSON-RPC JSON-RPC 2.0 specification
JSON JSON specification
Thunder Thunder API Reference

Description

DNSServer JSON-RPC interface.

Methods

The following methods are provided by the DNSServer interface:

Built-in methods:

Method Description
exists Checks if a JSON-RPC method or property exists

DNSServer interface methods:

Method Description
findByKey
countByType
findByType
add
remove

exists method

Checks if a JSON-RPC method or property exists.

Description

This method will return True for the following methods/properties: exists, findByKey, countByType, findByType, add, remove.

Parameters

Name Type M/O Description
params object mandatory ...
params.method string mandatory Name of the method or property to look up

Result

Name Type M/O Description
result boolean mandatory Denotes if the method exists or not

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.exists",
  "params": {
    "method": "methodName"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": false
}

findByKey method

Parameters

Name Type M/O Description
params object mandatory ...
params.designator string mandatory ...
params.key string mandatory ...

Result

Name Type M/O Description
result object mandatory ...
result.type string mandatory ... (must be one of the following: INVALID, RECORD_A, RECORD_AAAA, RECORD_CNAME, RECORD_HINFO, RECORD_MB, RECORD_MD, RECORD_MF, RECORD_MG, RECORD_MINFO, RECORD_MR, RECORD_MX, RECORD_NS, RECORD_NULL, RECORD_PTR, RECORD_SOA, RECORD_TXT, RECORD_WKS, REQUEST_ALL, REQUEST_AXFR, REQUEST_MAILA, REQUEST_MAILB)
result.key string mandatory ...
result.value string mandatory ...
result.ttl integer mandatory ...
result.priority integer mandatory ...

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.findByKey",
  "params": {
    "designator": "...",
    "key": "..."
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": {
    "type": "RECORD_A",
    "key": "...",
    "value": "...",
    "ttl": 0,
    "priority": 0
  }
}

countByType method

Parameters

Name Type M/O Description
params object mandatory ...
params.designator string mandatory ...
params.kind string mandatory ... (must be one of the following: INVALID, RECORD_A, RECORD_AAAA, RECORD_CNAME, RECORD_HINFO, RECORD_MB, RECORD_MD, RECORD_MF, RECORD_MG, RECORD_MINFO, RECORD_MR, RECORD_MX, RECORD_NS, RECORD_NULL, RECORD_PTR, RECORD_SOA, RECORD_TXT, RECORD_WKS, REQUEST_ALL, REQUEST_AXFR, REQUEST_MAILA, REQUEST_MAILB)

Result

Name Type M/O Description
result integer mandatory ...

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.countByType",
  "params": {
    "designator": "...",
    "kind": "RECORD_A"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": 0
}

findByType method

Parameters

Name Type M/O Description
params object mandatory ...
params.designator string mandatory ...
params.kind string mandatory ... (must be one of the following: INVALID, RECORD_A, RECORD_AAAA, RECORD_CNAME, RECORD_HINFO, RECORD_MB, RECORD_MD, RECORD_MF, RECORD_MG, RECORD_MINFO, RECORD_MR, RECORD_MX, RECORD_NS, RECORD_NULL, RECORD_PTR, RECORD_SOA, RECORD_TXT, RECORD_WKS, REQUEST_ALL, REQUEST_AXFR, REQUEST_MAILA, REQUEST_MAILB)
params.index integer mandatory ...

Result

Name Type M/O Description
result object mandatory ...
result.type string mandatory ... (must be one of the following: INVALID, RECORD_A, RECORD_AAAA, RECORD_CNAME, RECORD_HINFO, RECORD_MB, RECORD_MD, RECORD_MF, RECORD_MG, RECORD_MINFO, RECORD_MR, RECORD_MX, RECORD_NS, RECORD_NULL, RECORD_PTR, RECORD_SOA, RECORD_TXT, RECORD_WKS, REQUEST_ALL, REQUEST_AXFR, REQUEST_MAILA, REQUEST_MAILB)
result.key string mandatory ...
result.value string mandatory ...
result.ttl integer mandatory ...
result.priority integer mandatory ...

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.findByType",
  "params": {
    "designator": "...",
    "kind": "RECORD_A",
    "index": 0
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": {
    "type": "RECORD_A",
    "key": "...",
    "value": "...",
    "ttl": 0,
    "priority": 0
  }
}

add method

Parameters

Name Type M/O Description
params object mandatory ...
params.entry object mandatory ...
params.entry.type string mandatory ... (must be one of the following: INVALID, RECORD_A, RECORD_AAAA, RECORD_CNAME, RECORD_HINFO, RECORD_MB, RECORD_MD, RECORD_MF, RECORD_MG, RECORD_MINFO, RECORD_MR, RECORD_MX, RECORD_NS, RECORD_NULL, RECORD_PTR, RECORD_SOA, RECORD_TXT, RECORD_WKS, REQUEST_ALL, REQUEST_AXFR, REQUEST_MAILA, REQUEST_MAILB)
params.entry.key string mandatory ...
params.entry.value string mandatory ...
params.entry.ttl integer mandatory ...
params.entry.priority integer mandatory ...

Result

Name Type M/O Description
result null mandatory Always null

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.add",
  "params": {
    "entry": {
      "type": "RECORD_A",
      "key": "...",
      "value": "...",
      "ttl": 0,
      "priority": 0
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": null
}

remove method

Parameters

Name Type M/O Description
params object mandatory ...
params.record object mandatory ...
params.record.type string mandatory ... (must be one of the following: INVALID, RECORD_A, RECORD_AAAA, RECORD_CNAME, RECORD_HINFO, RECORD_MB, RECORD_MD, RECORD_MF, RECORD_MG, RECORD_MINFO, RECORD_MR, RECORD_MX, RECORD_NS, RECORD_NULL, RECORD_PTR, RECORD_SOA, RECORD_TXT, RECORD_WKS, REQUEST_ALL, REQUEST_AXFR, REQUEST_MAILA, REQUEST_MAILB)
params.record.key string mandatory ...
params.record.value string mandatory ...
params.record.ttl integer mandatory ...
params.record.priority integer mandatory ...

Result

Name Type M/O Description
result null mandatory Always null

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.remove",
  "params": {
    "record": {
      "type": "RECORD_A",
      "key": "...",
      "value": "...",
      "ttl": 0,
      "priority": 0
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": null
}