diff --git a/APIDOCS.md b/APIDOCS.md index b5777dc6..b70bdbd5 100644 --- a/APIDOCS.md +++ b/APIDOCS.md @@ -43,28 +43,127 @@ The DNS server uses a specific text format to define the name server address to - A combination of DNS-over-HTTPS URL and IP address together is as shown: `https://cloudflare-dns.com/dns-query (1.1.1.1)`. Here, the IP address of the domain name in the URL is specified in the round brackets. This allows the DNS server to use the specified IP address instead of trying to resolve it separately. - IPv6 addresses must always be enclosed in square brackets as shown: `cloudflare-dns.com ([2606:4700:4700::1111]:853)` or `[2606:4700:4700::1111]` -## Authentication API Calls +## User API Calls -These API calls allow to login or logout using credentials. Once logged in, a session token is returned which MUST be used with all other API calls. +These API calls allow to a user to login, logout, perform account management, etc. Once logged in, a session token is returned which MUST be used with all other API calls. ### Login -This call authenticates with the server and generates a session token to be used for subsequent API calls. The session token expires in 30 minutes from the last API call. +This call authenticates with the server and generates a session token to be used for subsequent API calls. The session token expires as per the user's session expiry timeout value (default 30 minutes) from the last API call. URL: -`http://localhost:5380/api/login?user=admin&pass=admin` +`http://localhost:5380/api/user/login?user=admin&pass=admin&includeInfo=true` + +OBSOLETE PATH: +`/api/login` + +PERMISSIONS: +None WHERE: -- `user`: The username. The built-in administrator username on the DNS server is `admin`. -- `pass`: The password for the user. The default password for `admin` user is `admin`. +- `user`: The username for the user account. The built-in administrator username on the DNS server is `admin`. +- `pass`: The password for the user account. The default password for `admin` user is `admin`. +- `includeInfo`: Includes basic info relevant for the user in response. WARNING: It is highly recommended to change the password on first use to avoid security related issues. RESPONSE: ``` { - "status": "ok", - "token": "932b2a3495852c15af01598f62563ae534460388b6a370bfbbb8bb6094b698e9" + "displayName": "Administrator", + "username": "admin", + "token": "932b2a3495852c15af01598f62563ae534460388b6a370bfbbb8bb6094b698e9", + "info": { + "version": "9.0", + "dnsServerDomain": "server1", + "defaultRecordTtl": 3600, + "permissions": { + "Dashboard": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Zones": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Cache": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Allowed": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Blocked": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Apps": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "DnsClient": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Settings": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "DhcpServer": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Administration": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Logs": { + "canView": true, + "canModify": true, + "canDelete": true + } + } + }, + "status": "ok" +} +``` + +WHERE: +- `token`: Is the session token generated that MUST be used with all subsequent API calls. + +### Create API Token + +Allows creating a non-expiring API token that can be used with automation scripts to make API calls. The token allows access to API calls with the same privileges as that of the user and thus its advised to create a separate user with limited permissions required for creating the API token. The token cannot be used to change the user's password, or update the user profile details. + +URL: +`http://localhost:5380/api/user/createToken?user=admin&pass=admin&tokenName=MyToken1&includeInfo=true` + +PERMISSIONS: +None + +WHERE: +- `user`: The username for the user account for which to generate the API token. +- `pass`: The password for the user account. +- `tokenName`: The name of the created token to identify its session. + +RESPONSE: +``` +{ + "username": "admin", + "tokenName": "MyToken1", + "token": "932b2a3495852c15af01598f62563ae534460388b6a370bfbbb8bb6094b698e9", + "status": "ok" } ``` @@ -73,13 +172,19 @@ WHERE: ### Logout -This call ends the session generated by the `login` call. The `token` generated by the `login` call would no longer be valid after calling `logout`. +This call ends the session generated by the `login` or the `createToken` call. The `token` would no longer be valid after calling the `logout` API. URL: -`http://localhost:5380/api/logout?token=932b2a3495852c15af01598f62563ae534460388b6a370bfbbb8bb6094b698e9` +`http://localhost:5380/api/user/logout?token=932b2a3495852c15af01598f62563ae534460388b6a370bfbbb8bb6094b698e9` + +OBSOLETE PATH: +`/api/logout` + +PERMISSIONS: +None WHERE: -- `token`: The session token generated by the `login` call. +- `token`: The session token generated by the `login` or the `createToken` call. RESPONSE: ``` @@ -88,14 +193,127 @@ RESPONSE: } ``` +### Get Session Info + +Returns the same info as that of the `login` or the `createToken` calls for the session specified by the token. + +URL: +`http://localhost:5380/api/user/session/get?token=932b2a3495852c15af01598f62563ae534460388b6a370bfbbb8bb6094b698e9` + +PERMISSIONS: +None + +WHERE: +- `token`: The session token generated by the `login` or the `createToken` call. + +RESPONSE: +``` +{ + "displayName": "Administrator", + "username": "admin", + "token": "932b2a3495852c15af01598f62563ae534460388b6a370bfbbb8bb6094b698e9", + "info": { + "version": "9.0", + "dnsServerDomain": "server1", + "defaultRecordTtl": 3600, + "permissions": { + "Dashboard": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Zones": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Cache": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Allowed": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Blocked": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Apps": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "DnsClient": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Settings": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "DhcpServer": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Administration": { + "canView": true, + "canModify": true, + "canDelete": true + }, + "Logs": { + "canView": true, + "canModify": true, + "canDelete": true + } + } + }, + "status": "ok" +} +``` + +### Delete User Session + +Allows deleting a session for the current user. + +URL: +`http://localhost:5380/api/user/session/delete?token=x&partialToken=620c3bfcd09d0a07` + +PERMISSIONS: +None + +WHERE: +- `token`: The session token generated by the `login` call. +- `partialToken`: The partial token as returned by the user profile details API call. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + ### Change Password -This call allows changing the password for the current logged in user. +Allows changing the password for the current logged in user account. NOTE: It is highly recommended to change the `admin` user password on first use to avoid security related issues. URL: -`http://localhost:5380/api/changePassword?token=x&pass=password` +`http://localhost:5380/api/user/changePassword?token=x&pass=password` + +OBSOLETE PATH: +`/api/changePassword` + +PERMISSIONS: +None WHERE: - `token`: The session token generated by the `login` call. @@ -108,14 +326,110 @@ RESPONSE: } ``` -## General DNS API Calls +### Get User Profile Details + +Gets the user account profile details. + +URL: +`http://localhost:5380/api/user/profile/get?token=x` + +PERMISSIONS: +None + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "response": { + "displayName": "Administrator", + "username": "admin", + "disabled": false, + "previousSessionLoggedOn": "2022-09-15T12:59:05.944Z", + "previousSessionRemoteAddress": "127.0.0.1", + "recentSessionLoggedOn": "2022-09-15T13:57:50.1843973Z", + "recentSessionRemoteAddress": "127.0.0.1", + "sessionTimeoutSeconds": 1800, + "memberOfGroups": [ + "Administrators" + ], + "sessions": [ + { + "username": "admin", + "isCurrentSession": true, + "partialToken": "620c3bfcd09d0a07", + "type": "Standard", + "tokenName": null, + "lastSeen": "2022-09-15T13:58:02.4728Z", + "lastSeenRemoteAddress": "127.0.0.1", + "lastSeenUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0" + } + ] + }, + "status": "ok" +} +``` + +### Set User Profile Details + +Allows changing user account profile values. + +URL: +`http://localhost:5380/api/user/profile/set?token=x&displayName=Administrator&sessionTimeoutSeconds=1800` + +PERMISSIONS: +None + +WHERE: +- `token`: The session token generated by the `login` call. +- `displayName` (optional): The display name to set for the user account. +- `sessionTimeoutSeconds` (optional): The session timeout value to set in seconds for the user account. + +RESPONSE: +``` +{ + "response": { + "displayName": "Administrator", + "username": "admin", + "disabled": false, + "previousSessionLoggedOn": "2022-09-15T12:59:05.944Z", + "previousSessionRemoteAddress": "127.0.0.1", + "recentSessionLoggedOn": "2022-09-15T13:57:50.1843973Z", + "recentSessionRemoteAddress": "127.0.0.1", + "sessionTimeoutSeconds": 1800, + "memberOfGroups": [ + "Administrators" + ], + "sessions": [ + { + "username": "admin", + "isCurrentSession": true, + "partialToken": "620c3bfcd09d0a07", + "type": "Standard", + "tokenName": null, + "lastSeen": "2022-09-15T14:00:50.288738Z", + "lastSeenRemoteAddress": "127.0.0.1", + "lastSeenUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0" + } + ] + }, + "status": "ok" +} +``` ### Check For Update This call requests the server to check for software update. URL: -`http://localhost:5380/api/checkForUpdate?token=x` +`http://localhost:5380/api/user/checkForUpdate?token=x` + +OBSOLETE PATH: +`/api/checkForUpdate` + +PERMISSIONS: +None WHERE: - `token`: The session token generated by the `login` call. @@ -125,8 +439,8 @@ RESPONSE: { "response": { "updateAvailable": true, - "updateVersion": "7.0", - "currentVersion": "7.0", + "updateVersion": "9.0", + "currentVersion": "8.1.4", "updateTitle": "New Update Available!", "updateMessage": "Follow the instructions from the link below to update the DNS server to the latest version. Read the change logs before installing the update to know if there are any breaking changes.", "downloadLink": "https://download.technitium.com/dns/DnsServerSetup.zip", @@ -137,285 +451,22 @@ RESPONSE: } ``` -### Get DNS Settings +## Dashboard API Calls -This call returns all the DNS server settings. - -URL: -`http://localhost:5380/api/getDnsSettings?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -RESPONSE: -``` -{ - "response": { - "version": "8.0", - "dnsServerDomain": "server1", - "dnsServerLocalEndPoints": [ - "0.0.0.0:53", - "[::]:53" - ], - "webServiceLocalAddresses": [ - "0.0.0.0", - "[::]" - ], - "webServiceHttpPort": 5380, - "webServiceEnableTls": false, - "webServiceHttpToTlsRedirect": false, - "webServiceTlsPort": 53443, - "webServiceUseSelfSignedTlsCertificate": false, - "webServiceTlsCertificatePath": null, - "webServiceTlsCertificatePassword": "************", - "enableDnsOverHttp": false, - "enableDnsOverTls": false, - "enableDnsOverHttps": false, - "dnsTlsCertificatePath": null, - "dnsTlsCertificatePassword": "************", - "tsigKeys": [ - { - "keyName": "key.example.com", - "sharedSecret": "AQ==", - "algorithmName": "hmac-sha256" - } - ], - "defaultRecordTtl": 3600, - "preferIPv6": false, - "udpPayloadSize": 1232, - "dnssecValidation": false, - "enableLogging": true, - "logQueries": true, - "useLocalTime": false, - "logFolder": "logs", - "maxLogFileDays": 365, - "maxStatFileDays": 365, - "recursion": "AllowOnlyForPrivateNetworks", - "recursionDeniedNetworks": [], - "recursionAllowedNetworks": [ - "192.168.1.0/24" - ], - "randomizeName": true, - "qnameMinimization": true, - "nsRevalidation": true, - "qpmLimitRequests", 0, - "qpmLimitErrors", 0, - "qpmLimitSampleMinutes": 5, - "qpmLimitIPv4PrefixLength": 24, - "qpmLimitIPv6PrefixLength": 56, - "serveStale": true, - "serveStaleTtl": 259200, - "temporaryDisableBlockingTill": "2021-10-10T01:14:27.1106773Z", - "cacheMinimumRecordTtl": 10, - "cacheMaximumRecordTtl": 86400, - "cacheNegativeRecordTtl": 300, - "cacheFailureRecordTtl": 60, - "cachePrefetchEligibility": 2, - "cachePrefetchTrigger": 9, - "cachePrefetchSampleIntervalInMinutes": 5, - "cachePrefetchSampleEligibilityHitsPerHour": 30, - "proxy": { - "type": "Socks5", - "address": "192.168.10.2", - "port": 9050, - "username": "username", - "password": "password", - "bypass": [ - "127.0.0.0/8", - "169.254.0.0/16", - "fe80::/10", - "::1", - "localhost" - ] - }, - "forwarders": [ - "https://cloudflare-dns.com/dns-query (1.1.1.1)", - "https://cloudflare-dns.com/dns-query (1.0.0.1)" - ], - "forwarderProtocol": "Https", - "enableBlocking": true, - "allowTxtBlockingReport": true, - "blockingType": "AnyAddress", - "customBlockingAddresses": [], - "blockListUrls": [ - "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" - ], - "blockListUpdateIntervalHours": 24, - "blockListNextUpdatedOn": "2021-09-11T12:09:22.244Z" - }, - "status": "ok" -} -``` - -### Set DNS Settings - -This call allows to change the DNS server settings. - -URL: -`http://localhost:5380/api/setDnsSettings?token=x&dnsServerDomain=server1&dnsServerLocalEndPoints=0.0.0.0:53,[::]:53&webServiceLocalAddresses=0.0.0.0,[::]&webServiceHttpPort=5380&webServiceEnableTls=false&webServiceTlsPort=53443&webServiceTlsCertificatePath=&webServiceTlsCertificatePassword=&enableDnsOverHttp=false&enableDnsOverTls=false&enableDnsOverHttps=false&dnsTlsCertificatePath=&dnsTlsCertificatePassword=&preferIPv6=false&logQueries=true&allowRecursion=true&allowRecursionOnlyForPrivateNetworks=true&randomizeName=true&cachePrefetchEligibility=2&cachePrefetchTrigger=9&cachePrefetchSampleIntervalInMinutes=5&cachePrefetchSampleEligibilityHitsPerHour=30&proxyType=socks5&proxyAddress=192.168.10.2&proxyPort=9050&proxyUsername=username&proxyPassword=password&proxyBypass=127.0.0.0/8,169.254.0.0/16,fe80::/10,::1,localhost&forwarders=192.168.10.2&forwarderProtocol=Udp&useNxDomainForBlocking=false&blockListUrls=https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts,https://mirror1.malwaredomains.com/files/justdomains,https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt,https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt` - -WHERE: -- `token`: The session token generated by the `login` call. -- `dnsServerDomain` (optional): The primary domain name used by this DNS Server to identify itself. -- `dnsServerLocalEndPoints` (optional): Local end points are the network interface IP addresses and ports you want the DNS Server to listen for requests. -- `webServiceLocalAddresses` (optional): Local addresses are the network interface IP addresses you want the web service to listen for requests. -- `webServiceHttpPort` (optional): Specify the TCP port number for the web console and this API web service. Default value is `5380`. -- `webServiceEnableTls` (optional): Set this to `true` to start the HTTPS service to acccess web service. -- `webServiceTlsPort` (optional): Specified the TCP port number for the web console for HTTPS access. -- `webServiceUseSelfSignedTlsCertificate` (optional): Set `true` for the web service to use an automatically generated self signed certificate when TLS certificate path is not specified. -- `webServiceTlsCertificatePath` (optional): Specify a PKCS #12 certificate (.pfx) file path on the server. The certificate must contain private key. This certificate is used by the web console for HTTPS access. -- `webServiceTlsCertificatePassword` (optional): Enter the certificate (.pfx) password, if any. -- `enableDnsOverHttp` (optional): Enable this option to accept DNS-over-HTTP requests for both wire and json response formats. It must be used with a TLS terminating reverse proxy like nginx and will work only on private networks. -- `enableDnsOverTls` (optional): Enable this option to accept DNS-over-TLS requests. -- `enableDnsOverHttps` (optional): Enable this option to accept DNS-over-HTTPS requests for both wire and json response formats. -- `dnsTlsCertificatePath` (optional): Specify a PKCS #12 certificate (.pfx) file path on the server. The certificate must contain private key. This certificate is used by the DNS-over-TLS and DNS-over-HTTPS optional protocols. -- `dnsTlsCertificatePassword` (optional): Enter the certificate (.pfx) password, if any. -- `tsigKeys` (optional): A pipe `|` separated multi row list of TSIG key name, shared secret, and algorithm. Set this parameter to `false` to remove all existing keys. Supported algorithms are [`hmac-md5.sig-alg.reg.int`, `hmac-sha1`, `hmac-sha256`, `hmac-sha256-128`, `hmac-sha384`, `hmac-sha384-192`, `hmac-sha512`, `hmac-sha512-256`]. -- `defaultRecordTtl` (optional): The default TTL value to use if not specified when adding or updating records in a Zone. -- `preferIPv6` (optional): DNS Server will use IPv6 for querying whenever possible with this option enabled. Default value is `false`. -- `udpPayloadSize` (optional): The maximum EDNS UDP payload size that can be used to avoid IP fragmentation. Valid range is 512-4096 bytes. Default value is `1232`. -- `dnssecValidation` (optional): Set this to `true` to enable DNSSEC validation. DNS Server will validate all responses from name servers or forwarders when this option is enabled. -- `enableLogging` (optional): Enable this option to log error and audit logs into the log file. Default value is `true`. -- `logQueries` (optional): Enable this option to log every query received by this DNS Server and the corresponding response answers into the log file. Default value is `false`. -- `useLocalTime` (optional): Enable this option to use local time instead of UTC for logging. Default value is `false`. -- `logFolder` (optional): The folder path on the server where the log files should be saved. The path can be relative to the DNS server config folder. Default value is `logs`. -- `maxLogFileDays` (optional): Max number of days to keep the log files. Log files older than the specified number of days will be deleted automatically. Recommended value is `365`. Set `0` to disable auto delete. -- `maxStatFileDays` (optional): Max number of days to keep the dashboard stats. Stat files older than the specified number of days will be deleted automatically. Recommended value is `365`. Set `0` to disable auto delete. -- `recursion` (optional): Sets the recursion policy for the DNS server. Valid values are [`Deny`, `Allow`, `AllowOnlyForPrivateNetworks`, `UseSpecifiedNetworks`]. -- `recursionDeniedNetworks` (optional): A comma separated list of network addresses in CIDR format that must be denied recursion. Set this parameter to `false` to remove existing values. These values are only used when `recursion` is set to `UseSpecifiedNetworks`. -- `recursionAllowedNetworks` (optional): A comma separated list of network addresses in CIDR format that must be allowed recursion. Set this parameter to `false` to remove existing values. These values are only used when `recursion` is set to `UseSpecifiedNetworks`. -- `randomizeName` (optional): Enables QNAME randomization [draft-vixie-dnsext-dns0x20-00](https://tools.ietf.org/html/draft-vixie-dnsext-dns0x20-00) when using UDP as the transport protocol. Default value is `true`. -- `qnameMinimization` (optional): Enables QNAME minimization [draft-ietf-dnsop-rfc7816bis-04](https://tools.ietf.org/html/draft-ietf-dnsop-rfc7816bis-04) when doing recursive resolution. Default value is `true`. -- `nsRevalidation` (optional): Enables [draft-ietf-dnsop-ns-revalidation](https://datatracker.ietf.org/doc/draft-ietf-dnsop-ns-revalidation/) for recursive resolution. Default value is `true`. -- `qpmLimitRequests` (optional): Sets the Queries Per Minute (QPM) limit on total number of requests that is enforces per client subnet. Set value to `0` to disable the feature. -- `qpmLimitErrors` (optional): Sets the Queries Per Minute (QPM) limit on total number of requests which generates an error response that is enforces per client subnet. Set value to `0` to disable the feature. Response with an RCODE of FormatError, ServerFailure, or Refused is considered as an error response. -- `qpmLimitSampleMinutes` (optional): Sets the client query stats sample size in minutes for QPM limit feature. Default value is `5`. -- `qpmLimitIPv4PrefixLength` (optional): Sets the client subnet IPv4 prefix length used to define the subnet. Default value is `24`. -- `qpmLimitIPv6PrefixLength` (optional): Sets the client subnet IPv6 prefix length used to define the subnet. Default value is `56`. -- `serveStale` (optional): Enable the serve stale feature to improve resiliency by using expired or stale records in cache when the DNS server is unable to reach the upstream or authoritative name servers. Default value is `true`. -- `serveStaleTtl` (optional): The TTL value in seconds which should be used for cached records that are expired. When the serve stale TTL too expires for a stale record, it gets removed from the cache. Recommended value is between 1-3 days and maximum supported value is 7 days. Default value is `259200`. -- `temporaryDisableBlockingTill` (read only): An ISO 8601 String with the Date and Time when the Temporary Blocking will end. -- `cacheMinimumRecordTtl` (optional): The minimum TTL value that a record can have in cache. Set a value to make sure that the records with TTL value than it stays in cache for a minimum duration. Default value is `10`. -- `cacheMaximumRecordTtl` (optional): The maximum TTL value that a record can have in cache. Set a lower value to allow the records to expire early. Default value is `86400`. -- `cacheNegativeRecordTtl` (optional): The negative TTL value to use when there is no SOA MINIMUM value available. Default value is `300`. -- `cacheFailureRecordTtl` (optional): The failure TTL value to used for caching failure responses. This allows storing failure record in cache and prevent frequent recursive resolution to name servers that are responding with `ServerFailure`. Default value is `60`. -- `cachePrefetchEligibility` (optional): The minimum initial TTL value of a record needed to be eligible for prefetching. -- `cachePrefetchTrigger` (optional): A record with TTL value less than trigger value will initiate prefetch operation immediately for itself. Set `0` to disable prefetching & auto prefetching. -- `cachePrefetchSampleIntervalInMinutes` (optional): The interval to sample eligible domain names from last hour stats for auto prefetch. -- `cachePrefetchSampleEligibilityHitsPerHour` (optional): Minimum required hits per hour for a domain name to be eligible for auto prefetch. -- `proxyType` (optional): The type of proxy protocol to be used. Valid values are [`None`, `Http`, `Socks5`]. -- `proxyAddress` (optional): The proxy server hostname or IP address. -- `proxyPort` (optional): The proxy server port. -- `proxyUsername` (optional): The proxy server username. -- `proxyPassword` (optional): The proxy server password. -- `proxyBypass` (optional): A comma separated bypass list consisting of IP addresses, network addresses in CIDR format, or host/domain names to never use proxy for. -- `forwarders` (optional): A comma separated list of forwarders to be used by this DNS server. Set this parameter to `false` string to remove existing forwarders so that the DNS server does recursive resolution by itself. -- `forwarderProtocol` (optional): The forwarder DNS transport protocol to be used. Valid values are [`Udp`, `Tcp`, `Tls`, `Https`]. -- `enableBlocking` (optional): Sets the DNS server to block domain names using Blocked Zone and Block List Zone. -- `allowTxtBlockingReport` (optional): Specifies if the DNS Server should respond with TXT records containing a blocked domain report for TXT type requests. -- `blockingType` (optional): Sets how the DNS server should respond to a blocked domain request. Valid values are [`AnyAddress`, `NxDomain`, `CustomAddress`] where `AnyAddress` is default which response with `0.0.0.0` and `::` IP addresses for blocked domains. Using `NxDomain` will respond with `NX Domain` response. `CustomAddress` will return the specified custom blocking addresses. -- `blockListNextUpdatedOn` (read only): An ISO 8601 String with the Date and Time when the blocklist will next be updated. -- `customBlockingAddresses` (optional): Set the custom blocking addresses to be used for blocked domain response. These addresses are returned only when `blockingType` is set to `CustomAddress`. -- `blockListUrls` (optional): A comma separated list of block list URLs that this server must automatically download and use with the block lists zone. DNS Server will use the data returned by the block list URLs to update the block list zone automatically every 24 hours. The expected file format is standard hosts file format or plain text file containing list of domains to block. Set this parameter to `false` to remove existing values. -- `blockListUpdateIntervalHours` (optional): The interval in hours to automatically download and update the block lists. Default value is `24`. - -RESPONSE: -This call returns the newly updated settings in the same format as that of the `getDnsSettings` call. - -### Force Update Block Lists - -This call allows to reset the next update schedule and force download and update of the block lists. - -URL: -`http://localhost:5380/api/forceUpdateBlockLists?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Temporarily Disable Block Lists - -This call temporarily disables the block lists and block list zones. - -URL: -`http://localhost:5380/api/temporaryDisableBlocking?token=x&minutes=5` - -WHERE: -- `token`: The session token generated by the `login` call. -- `minutes`: The time in minutes to disable the blocklist for. - -RESPONSE: -``` -{ - "status": "ok", - "response": { - "temporaryDisableBlockingTill": "2021-10-10T01:14:27.1106773Z" - } -} -``` - -### Backup Settings - -This call returns a zip file containing copies of all the items that were requested to be backed up. - -URL: -`http://localhost:5380/api/backupSettings?token=x&blockLists=true&logs=true&scopes=true&stats=true&zones=true&allowedZones=true&blockedZones=true&dnsSettings=true&logSettings=true` - -WHERE: -- `token`: The session token generated by the `login` call. -- `blockLists` (optional): Set to `true` to backup block lists cache files. Default value is `false`. -- `logs` (optional): Set to `true` to backup log files. Default value is `false`. -- `scopes` (optional): Set to `true` to backup DHCP scope files. Default value is `false`. -- `apps` (optional): Set to `true` to backup the installed DNS apps. Default value is `false`. -- `stats` (optional): Set to `true` to backup dashboard stats files. Default value is `false`. -- `zones` (optional): Set to `true` to backup DNS zone files. Default value is `false`. -- `allowedZones` (optional): Set to `true` to backup allowed zones file. Default value is `false`. -- `blockedZones` (optional): Set to `true` to backup blocked zones file. Default value is `false`. -- `dnsSettings` (optional): Set to `true` to backup DNS settings file. Default value is `false`. -- `logSettings` (optional): Set to `true` to backup log settings file. Default value is `false`. - -RESPONSE: -A zip file with content type `application/zip` and content disposition set to `attachment`. - -### Restore Settings - -This call restores selected items from a given backup zip file. - -URL: -`http://localhost:5380/api/restoreSettings?token=x&blockLists=true&logs=true&scopes=true&stats=true&zones=true&allowedZones=true&blockedZones=true&dnsSettings=true&logSettings=true&deleteExistingFiles=true` - -WHERE: -- `token`: The session token generated by the `login` call. -- `blockLists` (optional): Set to `true` to restore block lists cache files. Default value is `false`. -- `logs` (optional): Set to `true` to restore log files. Default value is `false`. -- `scopes` (optional): Set to `true` to restore DHCP scope files. Default value is `false`. -- `apps` (optional): Set to `true` to restore the DNS apps. Default value is `false`. -- `stats` (optional): Set to `true` to restore dashboard stats files. Default value is `false`. -- `zones` (optional): Set to `true` to restore DNS zone files. Default value is `false`. -- `allowedZones` (optional): Set to `true` to restore allowed zones file. Default value is `false`. -- `blockedZones` (optional): Set to `true` to restore blocked zones file. Default value is `false`. -- `dnsSettings` (optional): Set to `true` to restore DNS settings file. Default value is `false`. -- `logSettings` (optional): Set to `true` to restore log settings file. Default value is `false`. -- `deleteExistingFiles` (optional). Set to `true` to delete existing files for selected items. Default value is `false`. - -REQUEST: -This is a `POST` request call where the request must be multi-part form data with the backup zip file data in binary format. - -RESPONSE: -This call returns the newly updated settings in the same format as that of the `getDnsSettings` call. +These API calls provide access to dashboard stats and allow deleting stat files. ### Get Stats -This call returns the stats that are shown on the web console's dashboard. +Returns the DNS stats that are displayed on the web console dashboard. URL: -`http://localhost:5380/api/getStats?token=x&type=lastHour` +`http://localhost:5380/api/dashboard/stats/get?token=x&type=lastHour` + +OBSOLETE PATH: +`api/getStats` + +PERMISSIONS: +Dashboard: View WHERE: - `token`: The session token generated by the `login` call. @@ -1383,10 +1434,16 @@ RESPONSE: ### Get Top Stats -This call returns the top stats data for specified stats type. +Returns the top stats data for specified stats type. URL: -`http://localhost:5380/api/getStats?token=x&type=lastHour&statsType=TopClients&limit=1000` +`http://localhost:5380/api/dashboard/stats/getTop?token=x&type=lastHour&statsType=TopClients&limit=1000` + +OBSOLETE PATH: +`/api/getTopStats` + +PERMISSIONS: +Dashboard: View WHERE: - `token`: The session token generated by the `login` call. @@ -1448,14 +1505,18 @@ The response json will include the object with definition same in the `getStats` } ``` -## DNS Cache API Calls +### Delete All Stats -### Flush DNS Cache - -This call clears all the DNS cache from the server forcing the DNS server to make recursive queries again to populate the cache. +Permanently delete all hourly and daily stats files from the disk and clears all stats stored in memory. This call will clear all stats from the Dashboard. URL: -`http://localhost:5380/api/flushDnsCache?token=x` +`http://localhost:5380/api/dashboard/stats/deleteAll?token=x` + +OBSOLETE PATH: +`/api/deleteAllStats` + +PERMISSIONS: +Dashboard: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -1463,353 +1524,29 @@ WHERE: RESPONSE: ``` { - "status": "ok" -} -``` - -### List Cached Zones - -List all cached zones. - -URL: -`http://localhost:5380/api/listCachedZones?token=x&domain=google.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `domain` (Optional): The domain name to list records. If not passed, the domain is set to empty string which corresponds to the zone root. -- `direction` (Optional): Allows specifying the direction of browsing the zone. Valid values are [`up`, `down`] and the default value is `down` when parameter is missing. This option allows the server to skip empty labels in the domain name when browsing up or down. - -RESPONSE: -``` -{ - "response": { - "domain": "google.com", - "zones": [], - "records": [ - { - "name": "google.com", - "type": "A", - "ttl": "283 (4 mins 43 sec)", - "rData": { - "value": "216.58.199.174" - } - } - ] - }, - "status": "ok" -} -``` - -### Delete Cached Zone - -Deletes a specific zone from the DNS cache. - -URL: -`http://localhost:5380/api/deleteCachedZone?token=x&domain=google.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `domain`: The domain name to delete cached records from. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -## Allowed Zones API Calls - -### List Allowed Zones - -List all allowed zones. - -URL: -`http://localhost:5380/api/listAllowedZones?token=x&domain=google.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `domain` (Optional): The domain name to list records. If not passed, the domain is set to empty string which corresponds to the zone root. -- `direction` (Optional): Allows specifying the direction of browsing the zone. Valid values are [`up`, `down`] and the default value is `down` when parameter is missing. This option allows the server to skip empty labels in the domain name when browsing up or down. - -RESPONSE: -``` -{ - "response": { - "domain": "google.com", - "zones": [], - "records": [ - { - "name": "google.com", - "type": "NS", - "ttl": "14400 (4 hours)", - "rData": { - "value": "server1" - } - }, - { - "name": "google.com", - "type": "SOA", - "ttl": "14400 (4 hours)", - "rData": { - "primaryNameServer": "server1", - "responsiblePerson": "hostadmin.server1", - "serial": 1, - "refresh": 14400, - "retry": 3600, - "expire": 604800, - "minimum": 900 - } - } - ] - }, - "status": "ok" -} -``` - -### Import Allowed Zones - -Imports domain names into the Allowed Zones. - -URL: -`http://localhost:5380/api/importAllowedZones?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -REQUEST: -This is a `POST` request call where the content type of the request must be `application/x-www-form-urlencoded` and the content must be as shown below: - -``` -allowedZones=google.com,twitter.com -``` - -WHERE: -- `allowedZones`: A list of comma separated domain names that are to be imported. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Export Allowed Zones - -Allows exporting all the zones from the Allowed Zones as a text file. - -URL: -`http://localhost:5380/api/exportAllowedZones?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -RESPONSE: -Response is a downloadable text file with `Content-Type: text/plain` and `Content-Disposition: attachment`. - -### Delete Allowed Zone - -Allows deleting a zone from the Allowed Zones. - -URL: -`http://localhost:5380/api/deleteAllowedZone?token=x&domain=google.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `domain`: The domain name for the zone to be deleted. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Flush Allowed Zone - -Flushes the Allowed zone to clear all records. - -URL: -`http://localhost:5380/api/flushAllowedZone?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Allow Zone - -Adds a domain name into the Allowed Zones. - -URL: -`http://localhost:5380/api/allowZone?token=x&domain=google.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `domain`: The domain name for the zone to be added. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -## Blocked Zones API Calls - -### List Blocked Zones - -List all blocked zones. - -URL: -`http://localhost:5380/api/listBlockedZones?token=x&domain=google.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `domain` (Optional): The domain name to list records. If not passed, the domain is set to empty string which corresponds to the zone root. -- `direction` (Optional): Allows specifying the direction of browsing the zone. Valid values are [`up`, `down`] and the default value is `down` when parameter is missing. This option allows the server to skip empty labels in the domain name when browsing up or down. - -RESPONSE: -``` -{ - "response": { - "domain": "google.com", - "zones": [], - "records": [ - { - "name": "google.com", - "type": "NS", - "ttl": "14400 (4 hours)", - "rData": { - "value": "server1" - } - }, - { - "name": "google.com", - "type": "SOA", - "ttl": "14400 (4 hours)", - "rData": { - "primaryNameServer": "server1", - "responsiblePerson": "hostadmin.server1", - "serial": 1, - "refresh": 14400, - "retry": 3600, - "expire": 604800, - "minimum": 900 - } - } - ] - }, - "status": "ok" -} -``` - -### Import Blocked Zones - -Imports domain names into Blocked Zones. - -URL: -`http://localhost:5380/api/importBlockedZones?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -REQUEST: -This is a `POST` request call where the content type of the request must be `application/x-www-form-urlencoded` and the content must be as shown below: - -``` -blockedZones=google.com,twitter.com -``` - -WHERE: -- `blockedZones`: A list of comma separated domain names that are to be imported. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Export Blocked Zones - -Allows exporting all the zones from the Blocked Zones as a text file. - -URL: -`http://localhost:5380/api/exportBlockedZones?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -RESPONSE: -Response is a downloadable text file with `Content-Type: text/plain` and `Content-Disposition: attachment`. - -### Delete Blocked Zone - -Allows deleting a zone from the Blocked Zones. - -URL: -`http://localhost:5380/api/deleteBlockedZone?token=x&domain=google.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `domain`: The domain name for the zone to be deleted. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Flush Blocked Zone - -Flushes the Blocked zone to clear all records. - -URL: -`http://localhost:5380/api/flushBlockedZone?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Block Zone - -Adds a domain name into the Blocked Zones. - -URL: -`http://localhost:5380/api/blockZone?token=x&domain=google.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `domain`: The domain name for the zone to be added. - -RESPONSE: -``` -{ + "response": {}, "status": "ok" } ``` ## Authoritative Zone API Calls +These API calls allow managing all hosted zones on the DNS server. + ### List Zones -List all authoritative zones hosted on this DNS server. +List all authoritative zones hosted on this DNS server. The list contains only the zones that the user has View permissions for. These API calls requires permission for both the Zones section as well as the individual permission for each zone. URL: -`http://localhost:5380/api/zone/list?token=x` +`http://localhost:5380/api/zones/list?token=x` + +OBSOLETE PATH: +`/api/zone/list` +`/api/listZones` + +PERMISSIONS: +Zones: View +Zone: View WHERE: - `token`: The session token generated by the `login` call. @@ -1882,7 +1619,14 @@ RESPONSE: Creates a new authoritative zone. URL: -`http://localhost:5380/api/zone/create?token=x&zone=example.com&type=Primary` +`http://localhost:5380/api/zones/create?token=x&zone=example.com&type=Primary` + +OBSOLETE PATH: +`/api/zone/create` +`/api/createZone` + +PERMISSIONS: +Zones: Modify WHERE: - `token`: The session token generated by the `login` call. @@ -1913,18 +1657,309 @@ RESPONSE: WHERE: - `domain`: Will contain the zone that was created. This is specifically useful to know the reverse zone that was created. +### Enable Zone + +Enables an authoritative zone. + +URL: +`http://localhost:5380/api/zones/enable?token=x&zone=example.com` + +OBSOLETE PATH: +`/api/zone/enable` +`/api/enableZone` + +PERMISSIONS: +Zones: Modify +Zone: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `zone`: The domain name of the zone to be enabled. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Disable Zone + +Disables an authoritative zone. This will prevent the DNS server from responding for queries to this zone. + +URL: +`http://localhost:5380/api/zones/disable?token=x&zone=example.com` + +OBSOLETE PATH: +`/api/zone/disable` +`/api/disableZone` + +PERMISSIONS: +Zones: Modify +Zone: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `zone`: The domain name of the zone to be disabled. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Delete Zone + +Deletes an authoritative zone. + +URL: +`http://localhost:5380/api/zones/delete?token=x&zone=example.com` + +OBSOLETE PATH: +`/api/zone/delete` +`/api/deleteZone` + +PERMISSIONS: +Zones: Delete +Zone: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `zone`: The domain name of the zone to be deleted. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Resync Zone + +Allows resyncing a Secondary or Stub zone. This process will re-fetch all the records from the primary name server for the zone. + +URL: +`http://localhost:5380/api/zones/resync?token=x&zone=example.com` + +OBSOLETE PATH: +`/api/zone/resync` + +PERMISSIONS: +Zones: Modify +Zone: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `zone`: The domain name of the zone to resync. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Get Zone Options + +Gets the zone specific options. + +URL: +`http://localhost:5380/api/zones/options/get?token=x&zone=example.com` + +OBSOLETE PATH: +`/api/zone/options` + +PERMISSIONS: +Zones: Modify +Zone: View + +WHERE: +- `token`: The session token generated by the `login` call. +- `zone`: The domain name of the zone to get options. + +RESPONSE: +``` +{ + "response": { + "name": "example.com", + "type": "Primary", + "internal": false, + "disabled": false, + "zoneTransfer": "AllowOnlyZoneNameServers", + "zoneTransferNameServers": [], + "notify": "ZoneNameServers", + "notifyNameServers": [], + "zoneTransferTsigKeyNames": [ + "key.example.com" + ], + "availableTsigKeyNames": [ + "key.example.com" + ] + }, + "status": "ok" +} +``` + +### Set Zone Options + +Sets the zone specific options. + +URL: +`http://localhost:5380/api/zones/options/set?token=x&zone=example.com&disabled=false&zoneTransfer=Allow&zoneTransferNameServers=¬ify=ZoneNameServers¬ifyNameServers=` + +OBSOLETE PATH: +`/api/zone/options` + +PERMISSIONS: +Zones: Modify +Zone: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `zone`: The domain name of the zone to set options. +- `disabled` (optional): Sets if the zone is enabled or disabled. +- `zoneTransfer` (optional): Sets if the zone allows zone transfer. Valid options are [`Deny`, `Allow`, `AllowOnlyZoneNameServers`, `AllowOnlySpecifiedNameServers`]. +- `zoneTransferNameServers` (optional): A list of comma separated IP addresses which should be allowed to perform zone transfer. This list is enabled only when `zoneTransfer` option is set to `AllowOnlySpecifiedNameServers`. +- `notify` (optional): Sets if the DNS server should notify other DNS servers for zone updates. Valid options are [`None`, `ZoneNameServers`, `SpecifiedNameServers`]. +- `notifyNameServers` (optional): A list of comma separated IP addresses which should be notified by the DNS server for zone updates. This list is used only when `notify` option is set to `SpecifiedNameServers`. +- `zoneTransferTsigKeyNames` (optional): A list of comma separated TSIG keys names that are authorized to perform a zone transfer. Set this option to `false` to remove all keys. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Get Zone Permissions + +Gets the zone specific permissions. + +URL: +`http://localhost:5380/api/zones/permissions/get?token=x&zone=example.com&includeUsersAndGroups=true` + +PERMISSIONS: +Zones: Modify +Zone: View + +WHERE: +- `token`: The session token generated by the `login` call. +- `zone`: The domain name of the zone to get the permissions for. +- `includeUsersAndGroups`: Set to true to get a list of users and groups in the response. + +RESPONSE: +``` +{ + "response": { + "section": "Zones", + "subItem": "example.com", + "userPermissions": [ + { + "username": "admin", + "canView": true, + "canModify": true, + "canDelete": true + } + ], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": true, + "canDelete": true + } + ], + "users": [ + "admin", + "shreyas" + ], + "groups": [ + "Administrators", + "DHCP Administrators", + "DNS Administrators", + "Everyone" + ] + }, + "status": "ok" +} +``` + +### Set Zone Permissions + +Sets the zone specific permissions. + +URL: +`http://localhost:5380/api/zones/permissions/set?token=x&zone=example.com&userPermissions=admin|true|true|true&groupPermissions=Administrators|true|true|true|DNS%20Administrators|true|true|true` + +PERMISSIONS: +Zones: Modify +Zone: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `zone`: The domain name of the zone to get the permissions for. +- `userPermissions` (optional): A pipe `|` separated table data with each row containing username and boolean values for the view, modify and delete permissions. For example: user1|true|true|true|user2|true|false|false +- `groupPermissions` (optional): A pipe `|` separated table data with each row containing the group name and boolean values for the view, modify and delete permissions. For example: group1|true|true|true|group2|true|true|false + +RESPONSE: +``` +{ + "response": { + "section": "Zones", + "subItem": "example.com", + "userPermissions": [ + { + "username": "admin", + "canView": true, + "canModify": true, + "canDelete": true + } + ], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": true, + "canDelete": true + } + ] + }, + "status": "ok" +} +``` + ### Sign Zone Signs the primary zone (DNSSEC). URL: -`http://localhost:5380/api/zone/dnssec/sign?token=x&zone=example.com&algorithm=ECDSA&dnsKeyTtl=86400&zskRolloverDays=90&nxProof=NSEC3&iterations=0&saltLength=0&curve=P256` +`http://localhost:5380/api/zones/dnssec/sign?token=x&zone=example.com&algorithm=ECDSA&dnsKeyTtl=86400&zskRolloverDays=90&nxProof=NSEC3&iterations=0&saltLength=0&curve=P256` + +OBSOLETE PATH: +`/api/zone/dnssec/sign` + +PERMISSONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. - `zone`: The name of the primary zone to sign. - `algorithm`: The algorithm to be used for signing. Valid values are [`RSA`, `ECDSA`]. -- `hashAlgorithm` (optional): The hash algorithm to be used when using `RSA` algorithm. Valid values are [`MD5`, `SHA1, `SHA256`, `SHA512`]. This optional parameter is required when using `RSA` algorithm. +- `hashAlgorithm` (optional): The hash algorithm to be used when using `RSA` algorithm. Valid values are [`MD5`, `SHA1`, `SHA256`, `SHA512`]. This optional parameter is required when using `RSA` algorithm. - `kskKeySize` (optional): The size of the Key Signing Key (KSK) in bits to be used when using `RSA` algorithm. This optional parameter is required when using `RSA` algorithm. - `zskKeySize` (optional): The size of the Zone Signing Key (ZSK) in bits to be used when using `RSA` algorithm. This optional parameter is required when using `RSA` algorithm. - `curve` (optional): The name of the curve to be used when using `ECDSA` algorithm. Valid values are [`P256`, `P384`]. This optional parameter is required when using `ECDSA` algorithm. @@ -1946,7 +1981,14 @@ RESPONSE: Unsigns the primary zone (DNSSEC). URL: -`http://localhost:5380/api/zone/dnssec/unsign?token=x&zone=example.com +`http://localhost:5380/api/zones/dnssec/unsign?token=x&zone=example.com + +OBSOLETE PATH: +`/api/zone/dnssec/unsign` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -1964,7 +2006,14 @@ RESPONSE: Get the DNSSEC properties for the primary zone. URL: -`http://localhost:5380/api/zone/dnssec/getProperties?token=x&zone=example.com` +`http://localhost:5380/api/zones/dnssec/properties/get?token=x&zone=example.com` + +OBSOLETE PATH: +`/api/zone/dnssec/getProperties` + +PERMISSIONS: +Zones: Modify +Zone: View WHERE: - `token`: The session token generated by the `login` call. @@ -2010,7 +2059,14 @@ RESPONSE: Converts a primary zone from NSEC3 to NSEC for proof of non-existence. URL: -`http://localhost:5380/api/zone/dnssec/convertToNSEC?token=x&zone=example.com` +`http://localhost:5380/api/zones/dnssec/properties/convertToNSEC?token=x&zone=example.com` + +OBSOLETE PATH: +`/api/zone/dnssec/convertToNSEC` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2028,7 +2084,14 @@ RESPONSE: Converts a primary zone from NSEC to NSEC3 for proof of non-existence. URL: -`http://localhost:5380/api/zone/dnssec/convertToNSEC3?token=x&zone=example.com` +`http://localhost:5380/api/zones/dnssec/properties/convertToNSEC3?token=x&zone=example.com` + +OBSOLETE PATH: +`/api/zone/dnssec/convertToNSEC3` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2046,7 +2109,14 @@ RESPONSE: Updates the iteration and salt length parameters for NSEC3. URL: -`http://localhost:5380/api/zone/dnssec/updateNSEC3Params?token=x&zone=example.com&iterations=0&saltLength=0` +`http://localhost:5380/api/zones/dnssec/properties/updateNSEC3Params?token=x&zone=example.com&iterations=0&saltLength=0` + +OBSOLETE PATH: +`/api/zone/dnssec/updateNSEC3Params` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2066,7 +2136,14 @@ RESPONSE: Updates the TTL value for DNSKEY resource record set. The value can be updated only when all the DNSKEYs are in ready or active state. URL: -`http://localhost:5380/api/zone/dnssec/updateDnsKeyTtl?token=x&zone=example.com&ttl=86400` +`http://localhost:5380/api/zones/dnssec/properties/updateDnsKeyTtl?token=x&zone=example.com&ttl=86400` + +OBSOLETE PATH: +`/api/zone/dnssec/updateDnsKeyTtl` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2085,7 +2162,14 @@ RESPONSE: Generates a private key to be used for signing the zone with DNSSEC. URL: -`http://localhost:5380/api/zone/dnssec/generatePrivateKey?token=x&zone=example.com&keyType=KeySigningKey&algorithm=ECDSA&curve=P256` +`http://localhost:5380/api/zones/dnssec/properties/generatePrivateKey?token=x&zone=example.com&keyType=KeySigningKey&algorithm=ECDSA&curve=P256` + +OBSOLETE PATH: +`/api/zone/dnssec/generatePrivateKey` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2093,7 +2177,7 @@ WHERE: - `keyType`: The type of key for which the private key is to be generated. Valid values are [`KeySigningKey`, `ZoneSigningKey`]. - `rolloverDays` (optional): The frequency in days that the DNS server must automatically rollover the private key in the zone. Valid range is 0-365 days where 0 disables rollover. Default value is 90 days for Zone Signing Key (ZSK) and 0 days for Key Signing Key (KSK). - `algorithm`: The algorithm to be used for signing. Valid values are [`RSA`, `ECDSA`]. -- `hashAlgorithm` (optional): The hash algorithm to be used when using `RSA` algorithm. Valid values are [`MD5`, `SHA1, `SHA256`, `SHA512`]. This optional parameter is required when using `RSA` algorithm. +- `hashAlgorithm` (optional): The hash algorithm to be used when using `RSA` algorithm. Valid values are [`MD5`, `SHA1`, `SHA256`, `SHA512`]. This optional parameter is required when using `RSA` algorithm. - `keySize` (optional): The size of the generated private key in bits to be used when using `RSA` algorithm. This optional parameter is required when using `RSA` algorithm. - `curve` (optional): The name of the curve to be used when using `ECDSA` algorithm. Valid values are [`P256`, `P384`]. This optional parameter is required when using `ECDSA` algorithm. @@ -2109,7 +2193,14 @@ RESPONSE: Updates the DNSSEC private key properties. URL: -`http://localhost:5380/api/zone/dnssec/updatePrivateKey?token=x&zone=example.com&keyTag=1234&rolloverDays=90` +`http://localhost:5380/api/zones/dnssec/properties/updatePrivateKey?token=x&zone=example.com&keyTag=1234&rolloverDays=90` + +OBSOLETE PATH: +`/api/zone/dnssec/updatePrivateKey` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2129,7 +2220,14 @@ RESPONSE: Deletes a private key that has state set as `Generated`. Private keys with any other state cannot be delete. URL: -`http://localhost:5380/api/zone/dnssec/deletePrivateKey?token=x&zone=example.com&keyTag=12345` +`http://localhost:5380/api/zones/dnssec/properties/deletePrivateKey?token=x&zone=example.com&keyTag=12345` + +OBSOLETE PATH: +`/api/zone/dnssec/deletePrivateKey` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2148,7 +2246,14 @@ RESPONSE: Publishes all private keys that have state set as `Generated` by adding associated DNSKEY records for them. Once published, the keys will be automatically activated. For Key Signing Keys (KSK), once the state is set to `Ready` you can then safely replace the old DS record from the parent zone with a new DS key record for the KSK associated DNSKEY record. Once the new DS record is published at the parent zone, the DNS server will automatically detect and set the KSK state to `Active`. URL: -`http://localhost:5380/api/zone/dnssec/publishAllPrivateKeys?token=x&zone=example.com` +`http://localhost:5380/api/zones/dnssec/properties/publishAllPrivateKeys?token=x&zone=example.com` + +OBSOLETE PATH: +`/api/zone/dnssec/publishAllPrivateKeys` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2166,7 +2271,14 @@ RESPONSE: Generates and publishes a new private key for the given key that has to be rolled over. The old private key and its associated DNSKEY record will be automatically retired and removed safely once the new key is active. URL: -`http://localhost:5380/api/zone/dnssec/rolloverDnsKey?token=x&zone=example.com&keyTag=12345` +`http://localhost:5380/api/zones/dnssec/properties/rolloverDnsKey?token=x&zone=example.com&keyTag=12345` + +OBSOLETE PATH: +`/api/zone/dnssec/rolloverDnsKey` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2185,7 +2297,14 @@ RESPONSE: Retires the specified private key and its associated DNSKEY record and removes it safely. To retire an existing DNSKEY, there must be at least one active key available. URL: -`http://localhost:5380/api/zone/dnssec/retireDnsKey?token=x&zone=example.com&keyTag=12345` +`http://localhost:5380/api/zones/dnssec/properties/retireDnsKey?token=x&zone=example.com&keyTag=12345` + +OBSOLETE PATH: +`/api/zone/dnssec/retireDnsKey` + +PERMISSIONS: +Zones: Modify +Zone: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -2199,124 +2318,20 @@ RESPONSE: } ``` -### Delete Zone - -Deletes an authoritative zone. - -URL: -`http://localhost:5380/api/zone/delete?token=x&zone=example.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `zone`: The domain name of the zone to be deleted. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Enable Zone - -Enables an authoritative zone. - -URL: -`http://localhost:5380/api/zone/enable?token=x&zone=example.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `zone`: The domain name of the zone to be enabled. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Disable Zone - -Disables an authoritative zone. This will prevent the DNS server from responding for queries to this zone. - -URL: -`http://localhost:5380/api/zone/disable?token=x&zone=example.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `zone`: The domain name of the zone to be disabled. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - -### Get Zone Options - -Gets the zone specific options. - -URL: -`http://localhost:5380/api/zone/options/get?token=x&zone=example.com` - -WHERE: -- `token`: The session token generated by the `login` call. -- `zone`: The domain name of the zone to get options. - -RESPONSE: -``` -{ - "response": { - "name": "example.com", - "type": "Primary", - "internal": false, - "disabled": false, - "zoneTransfer": "AllowOnlyZoneNameServers", - "zoneTransferNameServers": [], - "notify": "ZoneNameServers", - "notifyNameServers": [], - "zoneTransferTsigKeyNames": [ - "key.example.com" - ], - "availableTsigKeyNames": [ - "key.example.com" - ] - }, - "status": "ok" -} -``` - -### Set Zone Options - -Sets the zone specific options. - -URL: -`http://localhost:5380/api/zone/options/set?token=x&zone=example.com&disabled=false&zoneTransfer=Allow&zoneTransferNameServers=¬ify=ZoneNameServers¬ifyNameServers=` - -WHERE: -- `token`: The session token generated by the `login` call. -- `zone`: The domain name of the zone to set options. -- `disabled` (optional): Sets if the zone is enabled or disabled. -- `zoneTransfer` (optional): Sets if the zone allows zone transfer. Valid options are [`Deny`, `Allow`, `AllowOnlyZoneNameServers`, `AllowOnlySpecifiedNameServers`]. -- `zoneTransferNameServers` (optional): A list of comma separated IP addresses which should be allowed to perform zone transfer. This list is enabled only when `zoneTransfer` option is set to `AllowOnlySpecifiedNameServers`. -- `notify` (optional): Sets if the DNS server should notify other DNS servers for zone updates. Valid options are [`None`, `ZoneNameServers`, `SpecifiedNameServers`]. -- `notifyNameServers` (optional): A list of comma separated IP addresses which should be notified by the DNS server for zone updates. This list is used only when `notify` option is set to `SpecifiedNameServers`. -- `zoneTransferTsigKeyNames` (optional): A list of comma separated TSIG keys names that are authorized to perform a zone transfer. Set this option to `false` to remove all keys. - -RESPONSE: -``` -{ - "status": "ok" -} -``` - ### Add Record Adds an resource record for an authoritative zone. URL: -`http://localhost:5380/api/zone/addRecord?token=x&domain=example.com&zone=example.com` +`http://localhost:5380/api/zones/records/add?token=x&domain=example.com&zone=example.com` + +OBSOLETE PATH: +`/api/zone/addRecord` +`/api/addRecord` + +PERMISSIONS: +Zones: None +Zone: Modify WHERE: - `token`: The session token generated by the `login` call. @@ -2392,7 +2407,15 @@ RESPONSE: Gets all records for a given authoritative zone. URL: -`http://localhost:5380/api/zone/getRecords?token=x&domain=example.com&zone=example.com` +`http://localhost:5380/api/zones/records/get?token=x&domain=example.com&zone=example.com` + +OBSOLETE PATH: +`/api/zone/getRecords` +`/api/getRecords` + +PERMISSIONS: +Zones: None +Zone: View WHERE: - `token`: The session token generated by the `login` call. @@ -2922,53 +2945,20 @@ RESPONSE: } ``` -### Delete Record - -Deletes a record from an authoritative zone. - -URL: -`http://localhost:5380/api/zone/deleteRecord?token=x&domain=example.com&zone=example.com&type=A&value=127.0.0.1` - -WHERE: -- `token`: The session token generated by the `login` call. -- `domain`: The domain name of the zone to delete the record. -- `zone` (optional): The name of the authoritative zone into which the `domain` exists. When unspecified, the closest authoritative zone will be used. -- `type`: The type of the resource record to delete. -- `ipAddress` (optional): This parameter is required when deleting `A` or `AAAA` record. -- `nameServer` (optional): This parameter is required when deleting `NS` record. -- `ptrName` (optional): This parameter is required when deleting `PTR` record. -- `preference` (optional): This parameter is required when deleting `MX` record. -- `exchange` (optional): This parameter is required when deleting `MX` record. -- `text` (optional): This parameter is required when deleting `TXT` record. -- `priority` (optional): This parameter is required when deleting the `SRV` record. -- `weight` (optional): This parameter is required when deleting the `SRV` record. -- `port` (optional): This parameter is required when deleting the `SRV` record. -- `target` (optional): This parameter is required when deleting the `SRV` record. -- `keyTag` (optional): This parameter is required when deleting `DS` record. -- `algorithm` (optional): This parameter is required when deleting `DS` record. -- `digestType` (optional): This parameter is required when deleting `DS` record. -- `digest` (optional): This parameter is required when deleting `DS` record. -- `flags` (optional): This is the flags parameter in the CAA record. This parameter is required when deleting the `CAA` record. -- `tag` (optional): This is the tag parameter in the CAA record. This parameter is required when deleting the `CAA` record. -- `value` (optional): This parameter is required when deleting the `CAA` record. -- `aname` (optional): This parameter is required when deleting the `ANAME` record. -- `protocol` (optional): This is the protocol parameter in the FWD record. Valid values are [`Udp`, `Tcp`, `Tls`, `Https`, `HttpsJson`]. This parameter is optional and default value `Udp` will be used when deleting the `FWD` record. -- `forwarder` (optional): This parameter is required when deleting the `FWD` record. - -RESPONSE: -``` -{ - "response": {}, - "status": "ok" -} -``` - ### Update Record Updates an existing record in an authoritative zone. URL: -`http://localhost:5380/api/zone/updateRecord?token=x&domain=mail.example.com&zone=example.com&type=A&value=127.0.0.1&newValue=127.0.0.2&ptr=false` +`http://localhost:5380/api/zones/records/update?token=x&domain=mail.example.com&zone=example.com&type=A&value=127.0.0.1&newValue=127.0.0.2&ptr=false` + +OBSOLETE PATH: +`/api/zone/updateRecord` +`/api/updateRecord` + +PERMISSIONS: +Zones: None +Zone: Modify WHERE: - `token`: The session token generated by the `login` call. @@ -3076,8 +3066,509 @@ RESPONSE: } ``` +### Delete Record + +Deletes a record from an authoritative zone. + +URL: +`http://localhost:5380/api/zones/records/delete?token=x&domain=example.com&zone=example.com&type=A&value=127.0.0.1` + +OBSOLETE PATH: +`/api/zone/deleteRecord` +`/api/deleteRecord` + +PERMISSIONS: +Zones: None +Zone: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `domain`: The domain name of the zone to delete the record. +- `zone` (optional): The name of the authoritative zone into which the `domain` exists. When unspecified, the closest authoritative zone will be used. +- `type`: The type of the resource record to delete. +- `ipAddress` (optional): This parameter is required when deleting `A` or `AAAA` record. +- `nameServer` (optional): This parameter is required when deleting `NS` record. +- `ptrName` (optional): This parameter is required when deleting `PTR` record. +- `preference` (optional): This parameter is required when deleting `MX` record. +- `exchange` (optional): This parameter is required when deleting `MX` record. +- `text` (optional): This parameter is required when deleting `TXT` record. +- `priority` (optional): This parameter is required when deleting the `SRV` record. +- `weight` (optional): This parameter is required when deleting the `SRV` record. +- `port` (optional): This parameter is required when deleting the `SRV` record. +- `target` (optional): This parameter is required when deleting the `SRV` record. +- `keyTag` (optional): This parameter is required when deleting `DS` record. +- `algorithm` (optional): This parameter is required when deleting `DS` record. +- `digestType` (optional): This parameter is required when deleting `DS` record. +- `digest` (optional): This parameter is required when deleting `DS` record. +- `flags` (optional): This is the flags parameter in the CAA record. This parameter is required when deleting the `CAA` record. +- `tag` (optional): This is the tag parameter in the CAA record. This parameter is required when deleting the `CAA` record. +- `value` (optional): This parameter is required when deleting the `CAA` record. +- `aname` (optional): This parameter is required when deleting the `ANAME` record. +- `protocol` (optional): This is the protocol parameter in the FWD record. Valid values are [`Udp`, `Tcp`, `Tls`, `Https`, `HttpsJson`]. This parameter is optional and default value `Udp` will be used when deleting the `FWD` record. +- `forwarder` (optional): This parameter is required when deleting the `FWD` record. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +## DNS Cache API Calls + +These API calls allow managing the DNS server cache. + +### List Cached Zones + +List all cached zones. + +URL: +`http://localhost:5380/api/cache/list?token=x&domain=google.com` + +OBSOLETE PATH: +`/api/listCachedZones` + +PERMISSIONS: +Cache: View + +WHERE: +- `token`: The session token generated by the `login` call. +- `domain` (Optional): The domain name to list records. If not passed, the domain is set to empty string which corresponds to the zone root. +- `direction` (Optional): Allows specifying the direction of browsing the zone. Valid values are [`up`, `down`] and the default value is `down` when parameter is missing. This option allows the server to skip empty labels in the domain name when browsing up or down. + +RESPONSE: +``` +{ + "response": { + "domain": "google.com", + "zones": [], + "records": [ + { + "name": "google.com", + "type": "A", + "ttl": "283 (4 mins 43 sec)", + "rData": { + "value": "216.58.199.174" + } + } + ] + }, + "status": "ok" +} +``` + +### Delete Cached Zone + +Deletes a specific zone from the DNS cache. + +URL: +`http://localhost:5380/api/cache/delete?token=x&domain=google.com` + +OBSOLETE PATH: +`/api/deleteCachedZone` + +PERMISSIONS: +Cache: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `domain`: The domain name to delete cached records from. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Flush DNS Cache + +This call clears all the DNS cache from the server forcing the DNS server to make recursive queries again to populate the cache. + +URL: +`http://localhost:5380/api/cache/flush?token=x` + +OBSOLETE PATH: +`/api/flushDnsCache` + +PERMISSIONS: +Cache: Delete + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +## Allowed Zones API Calls + +These API calls allow managing the Allowed zones. + +### List Allowed Zones + +List all allowed zones. + +URL: +`http://localhost:5380/api/allowed/list?token=x&domain=google.com` + +OBSOLETE PATH: +`/api/listAllowedZones` + +PERMISSIONS: +Allowed: View + +WHERE: +- `token`: The session token generated by the `login` call. +- `domain` (Optional): The domain name to list records. If not passed, the domain is set to empty string which corresponds to the zone root. +- `direction` (Optional): Allows specifying the direction of browsing the zone. Valid values are [`up`, `down`] and the default value is `down` when parameter is missing. This option allows the server to skip empty labels in the domain name when browsing up or down. + +RESPONSE: +``` +{ + "response": { + "domain": "google.com", + "zones": [], + "records": [ + { + "name": "google.com", + "type": "NS", + "ttl": "14400 (4 hours)", + "rData": { + "value": "server1" + } + }, + { + "name": "google.com", + "type": "SOA", + "ttl": "14400 (4 hours)", + "rData": { + "primaryNameServer": "server1", + "responsiblePerson": "hostadmin.server1", + "serial": 1, + "refresh": 14400, + "retry": 3600, + "expire": 604800, + "minimum": 900 + } + } + ] + }, + "status": "ok" +} +``` + +### Allow Zone + +Adds a domain name into the Allowed Zones. + +URL: +`http://localhost:5380/api/allowed/add?token=x&domain=google.com` + +OBSOLETE PATH: +`/api/allowZone` + +PERMISSIONS: +Allowed: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `domain`: The domain name for the zone to be added. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Delete Allowed Zone + +Allows deleting a zone from the Allowed Zones. + +URL: +`http://localhost:5380/api/allowed/delete?token=x&domain=google.com` + +OBSOLETE PATH: +`/api/deleteAllowedZone` + +PERMISSIONS: +Allowed: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `domain`: The domain name for the zone to be deleted. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Flush Allowed Zone + +Flushes the Allowed zone to clear all records. + +URL: +`http://localhost:5380/api/allowed/flush?token=x` + +OBSOLETE PATH: +`/api/flushAllowedZone` + +PERMISSIONS: +Allowed: Delete + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Import Allowed Zones + +Imports domain names into the Allowed Zones. + +URL: +`http://localhost:5380/api/allowed/import?token=x` + +OBSOLETE PATH: +`/api/importAllowedZones` + +PERMISSIONS: +Allowed: Modify + +WHERE: +- `token`: The session token generated by the `login` call. + +REQUEST: +This is a `POST` request call where the content type of the request must be `application/x-www-form-urlencoded` and the content must be as shown below: + +``` +allowedZones=google.com,twitter.com +``` + +WHERE: +- `allowedZones`: A list of comma separated domain names that are to be imported. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Export Allowed Zones + +Allows exporting all the zones from the Allowed Zones as a text file. + +URL: +`http://localhost:5380/api/allowed/export?token=x` + +OBSOLETE PATH: +`/api/exportAllowedZones` + +PERMISSIONS: +Allowed: View + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +Response is a downloadable text file with `Content-Type: text/plain` and `Content-Disposition: attachment`. + +## Blocked Zones API Calls + +These API calls allow managing the Blocked zones. + +### List Blocked Zones + +List all blocked zones. + +URL: +`http://localhost:5380/api/blocked/list?token=x&domain=google.com` + +OBSOLETE PATH: +`/api/listBlockedZones` + +PERMISSIONS: +Blocked: View + +WHERE: +- `token`: The session token generated by the `login` call. +- `domain` (Optional): The domain name to list records. If not passed, the domain is set to empty string which corresponds to the zone root. +- `direction` (Optional): Allows specifying the direction of browsing the zone. Valid values are [`up`, `down`] and the default value is `down` when parameter is missing. This option allows the server to skip empty labels in the domain name when browsing up or down. + +RESPONSE: +``` +{ + "response": { + "domain": "google.com", + "zones": [], + "records": [ + { + "name": "google.com", + "type": "NS", + "ttl": "14400 (4 hours)", + "rData": { + "value": "server1" + } + }, + { + "name": "google.com", + "type": "SOA", + "ttl": "14400 (4 hours)", + "rData": { + "primaryNameServer": "server1", + "responsiblePerson": "hostadmin.server1", + "serial": 1, + "refresh": 14400, + "retry": 3600, + "expire": 604800, + "minimum": 900 + } + } + ] + }, + "status": "ok" +} +``` + +### Block Zone + +Adds a domain name into the Blocked Zones. + +URL: +`http://localhost:5380/api/blocked/add?token=x&domain=google.com` + +OBSOLETE PATH: +`/api/blockZone` + +PERMISSIONS: +Blocked: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `domain`: The domain name for the zone to be added. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Delete Blocked Zone + +Allows deleting a zone from the Blocked Zones. + +URL: +`http://localhost:5380/api/blocked/delete?token=x&domain=google.com` + +OBSOLETE PATH: +`/api/deleteBlockedZone` + +PERMISSIONS: +Blocked: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `domain`: The domain name for the zone to be deleted. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Flush Blocked Zone + +Flushes the Blocked zone to clear all records. + +URL: +`http://localhost:5380/api/blocked/flush?token=x` + +OBSOLETE PATH: +`/api/flushBlockedZone` + +PERMISSIONS: +Blocked: Delete + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Import Blocked Zones + +Imports domain names into Blocked Zones. + +URL: +`http://localhost:5380/api/blocked/import?token=x` + +OBSOLETE PATH: +`/api/importBlockedZones` + +PERMISSIONS: +Blocked: Modify + +WHERE: +- `token`: The session token generated by the `login` call. + +REQUEST: +This is a `POST` request call where the content type of the request must be `application/x-www-form-urlencoded` and the content must be as shown below: + +``` +blockedZones=google.com,twitter.com +``` + +WHERE: +- `blockedZones`: A list of comma separated domain names that are to be imported. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Export Blocked Zones + +Allows exporting all the zones from the Blocked Zones as a text file. + +URL: +`http://localhost:5380/api/blocked/export?token=x` + +OBSOLETE PATH: +`/api/exportBlockedZones` + +PERMISSIONS: +Blocked: View + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +Response is a downloadable text file with `Content-Type: text/plain` and `Content-Disposition: attachment`. + ## DNS Apps API Calls +These API calls allows managing DNS Apps. + ### List Apps Lists all installed apps on the DNS server. If the DNS server has Internet access and is able to retrieve data from DNS App Store, the API call will also return if a store App has updates available. @@ -3085,6 +3576,9 @@ Lists all installed apps on the DNS server. If the DNS server has Internet acces URL: `http://localhost:5380/api/apps/list?token=x` +PERMISSIONS: +Apps/Zones/Logs: View + WHERE: - `token`: The session token generated by the `login` call. @@ -3135,6 +3629,9 @@ Lists all available apps on the DNS App Store. URL: `http://localhost:5380/api/apps/listStoreApps?token=x` +PERMISSIONS: +Apps: View + WHERE: - `token`: The session token generated by the `login` call. @@ -3200,6 +3697,9 @@ Download an app zip file from given URL and installs it on the DNS Server. URL: `http://localhost:5380/api/apps/downloadAndInstall?token=x&name=app-name&url=https://example.com/app.zip` +PERMISSIONS: +Apps: Delete + WHERE: - `token`: The session token generated by the `login` call. - `name`: The name of the app to install. @@ -3220,6 +3720,9 @@ Download an app zip file from given URL and updates an existing app installed on URL: `http://localhost:5380/api/apps/downloadAndUpdate?token=x&name=app-name&url=https://example.com/app.zip` +PERMISSIONS: +Apps: Delete + WHERE: - `token`: The session token generated by the `login` call. - `name`: The name of the app to install. @@ -3240,6 +3743,9 @@ Installs a DNS application on the DNS server. URL: `http://localhost:5380/api/apps/install?token=x&name=app-name` +PERMISSIONS: +Apps: Delete + WHERE: - `token`: The session token generated by the `login` call. - `name`: The name of the app to install. @@ -3261,6 +3767,9 @@ Allows to manually update an installed app using a provided app zip file. URL: `http://localhost:5380/api/apps/update?token=x&name=app-name` +PERMISSIONS: +Apps: Delete + WHERE: - `token`: The session token generated by the `login` call. - `name`: The name of the app to update. @@ -3282,6 +3791,9 @@ Uninstall an app from the DNS server. This does not remove any APP records that URL: `http://localhost:5380/api/apps/uninstall?token=x&name=app-name` +PERMISSIONS: +Apps: Delete + WHERE: - `token`: The session token generated by the `login` call. - `name`: The name of the app to uninstall. @@ -3299,7 +3811,13 @@ RESPONSE: Retrieve the DNS application config from the `dnsApp.config` file in the application folder. URL: -`http://localhost:5380/api/apps/getConfig?token=x&name=app-name` +`http://localhost:5380/api/apps/config/get?token=x&name=app-name` + +OBSOLETE PATH: +`/api/apps/getConfig` + +PERMISSIONS: +Apps: View WHERE: - `token`: The session token generated by the `login` call. @@ -3320,7 +3838,13 @@ RESPONSE: Saves the provided DNS application config into the `dnsApp.config` file in the application folder. URL: -`http://localhost:5380/api/apps/setConfig?token=x&name=app-name` +`http://localhost:5380/api/apps/config/set?token=x&name=app-name` + +OBSOLETE PATH: +`/api/apps/setConfig` + +PERMISSIONS: +Apps: Modify WHERE: - `token`: The session token generated by the `login` call. @@ -3341,10 +3865,18 @@ RESPONSE: ## DNS Client API Calls +These API calls allow interacting with the DNS Client section. + ### Resolve Query URL: -`http://localhost:5380/api/resolveQuery?token=x&server=this-server&domain=example.com&type=A&protocol=UDP` +`http://localhost:5380/api/dnsClient/resolve?token=x&server=this-server&domain=example.com&type=A&protocol=UDP` + +OBSOLETE PATH: +`/api/resolveQuery` + +PERMISSIONS: +DnsClient: View WHERE: - `token`: The session token generated by the `login` call. @@ -3353,7 +3885,7 @@ WHERE: - `type`: The type of the query. - `protocol` (optional): The DNS transport protocol to be used to query. Valid values are [`Udp`, `Tcp`, `Tls`, `Https`]. The default value of `Udp` is used when the parameter is missing. - `dnssec` (optional): Set to `true` to enable DNSSEC validation. -- `import` (optional): This parameter when set to `true` indicates that the response of the DNS query should be imported in the an authoritative zone on this DNS server. Default value is `false` when this parameter is missing. If a zone does not exists, a primary zone for the `domain` name is created and the records from the response are set into the zone. Import can be done only for primary and forwarder type of zones. When `type` is set to AXFR, then the import feature will work as if a zone transfer was requested and the complete zone will be updated as per the zone transfer response. Note that any existing record type for the given `type` will be overwritten when syncing the records. It is recommended to use `recursive-resolver` or the actual name server address for the `server` parameter when importing records. +- `import` (optional): This parameter when set to `true` indicates that the response of the DNS query should be imported in the an authoritative zone on this DNS server. Default value is `false` when this parameter is missing. If a zone does not exists, a primary zone for the `domain` name is created and the records from the response are set into the zone. Import can be done only for primary and forwarder type of zones. When `type` is set to AXFR, then the import feature will work as if a zone transfer was requested and the complete zone will be updated as per the zone transfer response. Note that any existing record type for the given `type` will be overwritten when syncing the records. It is recommended to use `recursive-resolver` or the actual name server address for the `server` parameter when importing records. You must have Zones Modify permission to create a zone or Zone Modify permission to import records into an existing zone. RESPONSE: ``` @@ -3408,6 +3940,1599 @@ RESPONSE: } ``` +## Settings API Calls + +These API calls allow managing the DNS server settings. + +### Get DNS Settings + +This call returns all the DNS server settings. + +URL: +`http://localhost:5380/api/settings/get?token=x` + +OBSOLETE PATH: +`/api/getDnsSettings` + +PERMISSIONS: +Settings: View + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "response": { + "version": "9.0", + "dnsServerDomain": "server1", + "dnsServerLocalEndPoints": [ + "0.0.0.0:53", + "[::]:53" + ], + "webServiceLocalAddresses": [ + "0.0.0.0", + "[::]" + ], + "webServiceHttpPort": 5380, + "webServiceEnableTls": false, + "webServiceHttpToTlsRedirect": false, + "webServiceTlsPort": 53443, + "webServiceUseSelfSignedTlsCertificate": false, + "webServiceTlsCertificatePath": "", + "webServiceTlsCertificatePassword": "************", + "enableDnsOverHttp": false, + "enableDnsOverTls": false, + "enableDnsOverHttps": false, + "dnsTlsCertificatePath": null, + "dnsTlsCertificatePassword": "************", + "tsigKeys": [], + "defaultRecordTtl": 3600, + "dnsAppsEnableAutomaticUpdate": true, + "preferIPv6": false, + "udpPayloadSize": 1232, + "dnssecValidation": true, + "resolverRetries": 2, + "resolverTimeout": 2000, + "resolverMaxStackCount": 16, + "forwarderRetries": 3, + "forwarderTimeout": 2000, + "forwarderConcurrency": 2, + "clientTimeout": 4000, + "tcpSendTimeout": 10000, + "tcpReceiveTimeout": 10000, + "enableLogging": true, + "logQueries": false, + "useLocalTime": false, + "logFolder": "logs", + "maxLogFileDays": 0, + "maxStatFileDays": 0, + "recursion": "AllowOnlyForPrivateNetworks", + "recursionDeniedNetworks": [], + "recursionAllowedNetworks": [], + "randomizeName": true, + "qnameMinimization": true, + "nsRevalidation": true, + "qpmLimitRequests": 0, + "qpmLimitErrors": 0, + "qpmLimitSampleMinutes": 5, + "qpmLimitIPv4PrefixLength": 24, + "qpmLimitIPv6PrefixLength": 56, + "serveStale": true, + "serveStaleTtl": 259200, + "cacheMaximumEntries": 10000, + "cacheMinimumRecordTtl": 10, + "cacheMaximumRecordTtl": 604800, + "cacheNegativeRecordTtl": 300, + "cacheFailureRecordTtl": 60, + "cachePrefetchEligibility": 2, + "cachePrefetchTrigger": 9, + "cachePrefetchSampleIntervalInMinutes": 5, + "cachePrefetchSampleEligibilityHitsPerHour": 30, + "proxy": null, + "forwarders": null, + "forwarderProtocol": "Udp", + "enableBlocking": true, + "allowTxtBlockingReport": true, + "blockingType": "AnyAddress", + "customBlockingAddresses": [], + "blockListUrls": null, + "blockListUpdateIntervalHours": 24 + }, + "status": "ok" +} +``` + +### Set DNS Settings + +This call allows to change the DNS server settings. + +URL: +`http://localhost:5380/api/settings/set?token=x&dnsServerDomain=server1&dnsServerLocalEndPoints=0.0.0.0:53,[::]:53&webServiceLocalAddresses=0.0.0.0,[::]&webServiceHttpPort=5380&webServiceEnableTls=false&webServiceTlsPort=53443&webServiceTlsCertificatePath=&webServiceTlsCertificatePassword=&enableDnsOverHttp=false&enableDnsOverTls=false&enableDnsOverHttps=false&dnsTlsCertificatePath=&dnsTlsCertificatePassword=&preferIPv6=false&logQueries=true&allowRecursion=true&allowRecursionOnlyForPrivateNetworks=true&randomizeName=true&cachePrefetchEligibility=2&cachePrefetchTrigger=9&cachePrefetchSampleIntervalInMinutes=5&cachePrefetchSampleEligibilityHitsPerHour=30&proxyType=socks5&proxyAddress=192.168.10.2&proxyPort=9050&proxyUsername=username&proxyPassword=password&proxyBypass=127.0.0.0/8,169.254.0.0/16,fe80::/10,::1,localhost&forwarders=192.168.10.2&forwarderProtocol=Udp&useNxDomainForBlocking=false&blockListUrls=https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts,https://mirror1.malwaredomains.com/files/justdomains,https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt,https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt` + +OBSOLETE PATH: +`/api/setDnsSettings` + +PERMISSIONS: +Settings: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `dnsServerDomain` (optional): The primary domain name used by this DNS Server to identify itself. +- `dnsServerLocalEndPoints` (optional): Local end points are the network interface IP addresses and ports you want the DNS Server to listen for requests. +- `webServiceLocalAddresses` (optional): Local addresses are the network interface IP addresses you want the web service to listen for requests. +- `webServiceHttpPort` (optional): Specify the TCP port number for the web console and this API web service. Default value is `5380`. +- `webServiceEnableTls` (optional): Set this to `true` to start the HTTPS service to acccess web service. +- `webServiceTlsPort` (optional): Specified the TCP port number for the web console for HTTPS access. +- `webServiceUseSelfSignedTlsCertificate` (optional): Set `true` for the web service to use an automatically generated self signed certificate when TLS certificate path is not specified. +- `webServiceTlsCertificatePath` (optional): Specify a PKCS #12 certificate (.pfx) file path on the server. The certificate must contain private key. This certificate is used by the web console for HTTPS access. +- `webServiceTlsCertificatePassword` (optional): Enter the certificate (.pfx) password, if any. +- `enableDnsOverHttp` (optional): Enable this option to accept DNS-over-HTTP requests for both wire and json response formats. It must be used with a TLS terminating reverse proxy like nginx and will work only on private networks. +- `enableDnsOverTls` (optional): Enable this option to accept DNS-over-TLS requests. +- `enableDnsOverHttps` (optional): Enable this option to accept DNS-over-HTTPS requests for both wire and json response formats. +- `dnsTlsCertificatePath` (optional): Specify a PKCS #12 certificate (.pfx) file path on the server. The certificate must contain private key. This certificate is used by the DNS-over-TLS and DNS-over-HTTPS optional protocols. +- `dnsTlsCertificatePassword` (optional): Enter the certificate (.pfx) password, if any. +- `tsigKeys` (optional): A pipe `|` separated multi row list of TSIG key name, shared secret, and algorithm. Set this parameter to `false` to remove all existing keys. Supported algorithms are [`hmac-md5.sig-alg.reg.int`, `hmac-sha1`, `hmac-sha256`, `hmac-sha256-128`, `hmac-sha384`, `hmac-sha384-192`, `hmac-sha512`, `hmac-sha512-256`]. +- `defaultRecordTtl` (optional): The default TTL value to use if not specified when adding or updating records in a Zone. +- `dnsAppsEnableAutomaticUpdate` (optional): Set to `true` to allow DNS server to automatically update the DNS Apps from the DNS App Store. The DNS Server will check for updates every 24 hrs when this option is enabled. +- `preferIPv6` (optional): DNS Server will use IPv6 for querying whenever possible with this option enabled. Default value is `false`. +- `udpPayloadSize` (optional): The maximum EDNS UDP payload size that can be used to avoid IP fragmentation. Valid range is 512-4096 bytes. Default value is `1232`. +- `dnssecValidation` (optional): Set this to `true` to enable DNSSEC validation. DNS Server will validate all responses from name servers or forwarders when this option is enabled. +- `resolverRetries` (optional): The number of retries that the recursive resolver must do. +- `resolverTimeout` (optional): The timeout value in milliseconds for the recursive resolver. +- `resolverMaxStackCount` (optional): The max stack count that the recursive resolver must use. +- `forwarderRetries` (optional): The number of retries that the forwarder DNS client must do. +- `forwarderTimeout` (optional): The timeout value in milliseconds for the forwarder DNS client. +- `forwarderConcurrency` (optional): The number of concurrent requests that the forwarder DNS client should do. +- `clientTimeout` (optional): The amount of time the DNS server must wait in milliseconds before responding with a ServerFailure response to a client request when no answer is available. +- `tcpSendTimeout` (optional): The amount of time in milliseconds a TCP socket must wait for an ACK before closing the connection. This option will apply for DNS requests being received by the DNS Server over TCP, TLS, or HTTPS transports. +- `tcpReceiveTimeout` (optional): The amount of time in milliseconds a TCP socket must wait for data before closing the connection. This option will apply for DNS requests being received by the DNS Server over TCP, TLS, or HTTPS transports. +- `enableLogging` (optional): Enable this option to log error and audit logs into the log file. Default value is `true`. +- `logQueries` (optional): Enable this option to log every query received by this DNS Server and the corresponding response answers into the log file. Default value is `false`. +- `useLocalTime` (optional): Enable this option to use local time instead of UTC for logging. Default value is `false`. +- `logFolder` (optional): The folder path on the server where the log files should be saved. The path can be relative to the DNS server config folder. Default value is `logs`. +- `maxLogFileDays` (optional): Max number of days to keep the log files. Log files older than the specified number of days will be deleted automatically. Recommended value is `365`. Set `0` to disable auto delete. +- `maxStatFileDays` (optional): Max number of days to keep the dashboard stats. Stat files older than the specified number of days will be deleted automatically. Recommended value is `365`. Set `0` to disable auto delete. +- `recursion` (optional): Sets the recursion policy for the DNS server. Valid values are [`Deny`, `Allow`, `AllowOnlyForPrivateNetworks`, `UseSpecifiedNetworks`]. +- `recursionDeniedNetworks` (optional): A comma separated list of network addresses in CIDR format that must be denied recursion. Set this parameter to `false` to remove existing values. These values are only used when `recursion` is set to `UseSpecifiedNetworks`. +- `recursionAllowedNetworks` (optional): A comma separated list of network addresses in CIDR format that must be allowed recursion. Set this parameter to `false` to remove existing values. These values are only used when `recursion` is set to `UseSpecifiedNetworks`. +- `randomizeName` (optional): Enables QNAME randomization [draft-vixie-dnsext-dns0x20-00](https://tools.ietf.org/html/draft-vixie-dnsext-dns0x20-00) when using UDP as the transport protocol. Default value is `true`. +- `qnameMinimization` (optional): Enables QNAME minimization [draft-ietf-dnsop-rfc7816bis-04](https://tools.ietf.org/html/draft-ietf-dnsop-rfc7816bis-04) when doing recursive resolution. Default value is `true`. +- `nsRevalidation` (optional): Enables [draft-ietf-dnsop-ns-revalidation](https://datatracker.ietf.org/doc/draft-ietf-dnsop-ns-revalidation/) for recursive resolution. Default value is `true`. +- `qpmLimitRequests` (optional): Sets the Queries Per Minute (QPM) limit on total number of requests that is enforces per client subnet. Set value to `0` to disable the feature. +- `qpmLimitErrors` (optional): Sets the Queries Per Minute (QPM) limit on total number of requests which generates an error response that is enforces per client subnet. Set value to `0` to disable the feature. Response with an RCODE of FormatError, ServerFailure, or Refused is considered as an error response. +- `qpmLimitSampleMinutes` (optional): Sets the client query stats sample size in minutes for QPM limit feature. Default value is `5`. +- `qpmLimitIPv4PrefixLength` (optional): Sets the client subnet IPv4 prefix length used to define the subnet. Default value is `24`. +- `qpmLimitIPv6PrefixLength` (optional): Sets the client subnet IPv6 prefix length used to define the subnet. Default value is `56`. +- `serveStale` (optional): Enable the serve stale feature to improve resiliency by using expired or stale records in cache when the DNS server is unable to reach the upstream or authoritative name servers. Default value is `true`. +- `serveStaleTtl` (optional): The TTL value in seconds which should be used for cached records that are expired. When the serve stale TTL too expires for a stale record, it gets removed from the cache. Recommended value is between 1-3 days and maximum supported value is 7 days. Default value is `259200`. +- `temporaryDisableBlockingTill` (read only): An ISO 8601 String with the Date and Time when the Temporary Blocking will end. +- `cacheMinimumRecordTtl` (optional): The minimum TTL value that a record can have in cache. Set a value to make sure that the records with TTL value than it stays in cache for a minimum duration. Default value is `10`. +- `cacheMaximumRecordTtl` (optional): The maximum TTL value that a record can have in cache. Set a lower value to allow the records to expire early. Default value is `86400`. +- `cacheNegativeRecordTtl` (optional): The negative TTL value to use when there is no SOA MINIMUM value available. Default value is `300`. +- `cacheFailureRecordTtl` (optional): The failure TTL value to used for caching failure responses. This allows storing failure record in cache and prevent frequent recursive resolution to name servers that are responding with `ServerFailure`. Default value is `60`. +- `cachePrefetchEligibility` (optional): The minimum initial TTL value of a record needed to be eligible for prefetching. +- `cachePrefetchTrigger` (optional): A record with TTL value less than trigger value will initiate prefetch operation immediately for itself. Set `0` to disable prefetching & auto prefetching. +- `cachePrefetchSampleIntervalInMinutes` (optional): The interval to sample eligible domain names from last hour stats for auto prefetch. +- `cachePrefetchSampleEligibilityHitsPerHour` (optional): Minimum required hits per hour for a domain name to be eligible for auto prefetch. +- `proxyType` (optional): The type of proxy protocol to be used. Valid values are [`None`, `Http`, `Socks5`]. +- `proxyAddress` (optional): The proxy server hostname or IP address. +- `proxyPort` (optional): The proxy server port. +- `proxyUsername` (optional): The proxy server username. +- `proxyPassword` (optional): The proxy server password. +- `proxyBypass` (optional): A comma separated bypass list consisting of IP addresses, network addresses in CIDR format, or host/domain names to never use proxy for. +- `forwarders` (optional): A comma separated list of forwarders to be used by this DNS server. Set this parameter to `false` string to remove existing forwarders so that the DNS server does recursive resolution by itself. +- `forwarderProtocol` (optional): The forwarder DNS transport protocol to be used. Valid values are [`Udp`, `Tcp`, `Tls`, `Https`]. +- `enableBlocking` (optional): Sets the DNS server to block domain names using Blocked Zone and Block List Zone. +- `allowTxtBlockingReport` (optional): Specifies if the DNS Server should respond with TXT records containing a blocked domain report for TXT type requests. +- `blockingType` (optional): Sets how the DNS server should respond to a blocked domain request. Valid values are [`AnyAddress`, `NxDomain`, `CustomAddress`] where `AnyAddress` is default which response with `0.0.0.0` and `::` IP addresses for blocked domains. Using `NxDomain` will respond with `NX Domain` response. `CustomAddress` will return the specified custom blocking addresses. +- `blockListNextUpdatedOn` (read only): An ISO 8601 String with the Date and Time when the blocklist will next be updated. +- `customBlockingAddresses` (optional): Set the custom blocking addresses to be used for blocked domain response. These addresses are returned only when `blockingType` is set to `CustomAddress`. +- `blockListUrls` (optional): A comma separated list of block list URLs that this server must automatically download and use with the block lists zone. DNS Server will use the data returned by the block list URLs to update the block list zone automatically every 24 hours. The expected file format is standard hosts file format or plain text file containing list of domains to block. Set this parameter to `false` to remove existing values. +- `blockListUpdateIntervalHours` (optional): The interval in hours to automatically download and update the block lists. Default value is `24`. + +RESPONSE: +This call returns the newly updated settings in the same format as that of the `getDnsSettings` call. + +### Force Update Block Lists + +This call allows to reset the next update schedule and force download and update of the block lists. + +URL: +`http://localhost:5380/api/settings/forceUpdateBlockLists?token=x` + +OBSOLETE PATH: +`/api/forceUpdateBlockLists` + +PERMISSIONS: +Settings: Modify + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "status": "ok" +} +``` + +### Temporarily Disable Block Lists + +This call temporarily disables the block lists and block list zones. + +URL: +`http://localhost:5380/api/settings/temporaryDisableBlocking?token=x&minutes=5` + +OBSOLETE PATH: +`/api/temporaryDisableBlocking` + +PERMISSIONS: +Settings: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `minutes`: The time in minutes to disable the blocklist for. + +RESPONSE: +``` +{ + "status": "ok", + "response": { + "temporaryDisableBlockingTill": "2021-10-10T01:14:27.1106773Z" + } +} +``` + +### Backup Settings + +This call returns a zip file containing copies of all the items that were requested to be backed up. + +URL: +`http://localhost:5380/api/settings/backup?token=x&blockLists=true&logs=true&scopes=true&stats=true&zones=true&allowedZones=true&blockedZones=true&dnsSettings=true&logSettings=true&authConfig=true` + +OBSOLETE PATH: +`/api/backupSettings` + +PERMISSIONS: +Settings: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `blockLists` (optional): Set to `true` to backup block lists cache files. Default value is `false`. +- `logs` (optional): Set to `true` to backup log files. Default value is `false`. +- `scopes` (optional): Set to `true` to backup DHCP scope files. Default value is `false`. +- `apps` (optional): Set to `true` to backup the installed DNS apps. Default value is `false`. +- `stats` (optional): Set to `true` to backup dashboard stats files. Default value is `false`. +- `zones` (optional): Set to `true` to backup DNS zone files. Default value is `false`. +- `allowedZones` (optional): Set to `true` to backup allowed zones file. Default value is `false`. +- `blockedZones` (optional): Set to `true` to backup blocked zones file. Default value is `false`. +- `dnsSettings` (optional): Set to `true` to backup DNS settings file. Default value is `false`. +- `logSettings` (optional): Set to `true` to backup log settings file. Default value is `false`. +- `authConfig` (optional): Set to `true` to backup the authentication config file. Default value is `false`. + +RESPONSE: +A zip file with content type `application/zip` and content disposition set to `attachment`. + +### Restore Settings + +This call restores selected items from a given backup zip file. + +URL: +`http://localhost:5380/api/settings/restore?token=x&blockLists=true&logs=true&scopes=true&stats=true&zones=true&allowedZones=true&blockedZones=true&dnsSettings=true&logSettings=true&deleteExistingFiles=true&authConfig=true` + +OBSOLETE PATH: +`/api/restoreSettings` + +PERMISSIONS: +Settings: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `blockLists` (optional): Set to `true` to restore block lists cache files. Default value is `false`. +- `logs` (optional): Set to `true` to restore log files. Default value is `false`. +- `scopes` (optional): Set to `true` to restore DHCP scope files. Default value is `false`. +- `apps` (optional): Set to `true` to restore the DNS apps. Default value is `false`. +- `stats` (optional): Set to `true` to restore dashboard stats files. Default value is `false`. +- `zones` (optional): Set to `true` to restore DNS zone files. Default value is `false`. +- `allowedZones` (optional): Set to `true` to restore allowed zones file. Default value is `false`. +- `blockedZones` (optional): Set to `true` to restore blocked zones file. Default value is `false`. +- `dnsSettings` (optional): Set to `true` to restore DNS settings file. Default value is `false`. +- `logSettings` (optional): Set to `true` to restore log settings file. Default value is `false`. +- `authConfig` (optional): Set to `true` to restore the authentication config file. Default value is `false`. +- `deleteExistingFiles` (optional). Set to `true` to delete existing files for selected items. Default value is `false`. + +REQUEST: +This is a `POST` request call where the request must be multi-part form data with the backup zip file data in binary format. + +RESPONSE: +This call returns the newly updated settings in the same format as that of the `getDnsSettings` call. + +## DHCP API Calls + +Allows managing the built-in DHCP server. + +### List DHCP Leases + +Lists all the DHCP leases. + +URL: +`http://localhost:5380/api/dhcp/leases/list?token=x` + +OBSOLETE PATH: +`/api/listDhcpLeases` + +PERMISSIONS: +DhcpServer: View + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "response": { + "leases": [ + { + "scope": "Default", + "type": "Reserved", + "hardwareAddress": "00-00-00-00-00-00", + "clientIdentifier": "1-000000000000", + "address": "192.168.1.5", + "hostName": "server1.local", + "leaseObtained": "08/25/2020 17:52:51", + "leaseExpires": "09/26/2020 14:27:12" + }, + { + "scope": "Default", + "type": "Dynamic", + "hardwareAddress": "00-00-00-00-00-00", + "clientIdentifier": "1-000000000000", + "address": "192.168.1.13", + "hostName": null, + "leaseObtained": "06/15/2020 16:41:46", + "leaseExpires": "09/25/2020 12:39:54" + }, + { + "scope": "Default", + "type": "Dynamic", + "hardwareAddress": "00-00-00-00-00-00", + "clientIdentifier": "1-000000000000", + "address": "192.168.1.15", + "hostName": "desktop-ea2miaf.local", + "leaseObtained": "06/18/2020 12:19:03", + "leaseExpires": "09/25/2020 12:17:11" + }, + ] + }, + "status": "ok" +} +``` + +### Remove DHCP Lease + +Removes a dynamic or reserved lease allocation. This API must be used carefully to make sure that there is no IP address conflict caused by removing a lease. + +URL: +`http://localhost:5380/api/dhcp/leases/remove?token=x&name=Default&hardwareAddress=00:00:00:00:00:00` + +OBSOLETE PATH: +`/api/removeDhcpLease` + +PERMISSIONS: +DhcpServer: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. +- `clientIdentifier` (optional): The client identifier for the lease. Either `hardwareAddress` or `clientIdentifier` must be specified. +- `hardwareAddress` (optional): The MAC address of the device bearing the dynamic/reserved lease. Either `hardwareAddress` or `clientIdentifier` must be specified. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### Convert To Reserved Lease + +Converts a dynamic lease to reserved lease. + +URL: +`http://localhost:5380/api/dhcp/leases/convertToReserved?token=x&name=Default&hardwareAddress=00:00:00:00:00:00` + +OBSOLETE PATH: +`/api/convertToReservedLease` + +PERMISSIONS: +DhcpServer: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. +- `clientIdentifier` (optional): The client identifier for the lease. Either `hardwareAddress` or `clientIdentifier` must be specified. +- `hardwareAddress` (optional): The MAC address of the device bearing the dynamic lease. Either `hardwareAddress` or `clientIdentifier` must be specified. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### Convert To Dynamic Lease + +Converts a reserved lease to dynamic lease. + +URL: +`http://localhost:5380/api/dhcp/leases/convertToDynamic?token=x&name=Default&hardwareAddress=00:00:00:00:00:00` + +OBSOLETE PATH: +`/api/convertToDynamicLease` + +PERMISSIONS: +DhcpServer: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. +- `clientIdentifier` (optional): The client identifier for the lease. Either `hardwareAddress` or `clientIdentifier` must be specified. +- `hardwareAddress` (optional): The MAC address of the device bearing the reserved lease. Either `hardwareAddress` or `clientIdentifier` must be specified. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### List DHCP Scopes + +Lists all the DHCP scopes available on the server. + +URL: +`http://localhost:5380/api/dhcp/scopes/list?token=x` + +OBSOLETE PATH: +`/api/listDhcpScopes` + +PERMISSIONS: +DhcpServer: View + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "response": { + "scopes": [ + { + "name": "Default", + "enabled": false, + "startingAddress": "192.168.1.1", + "endingAddress": "192.168.1.254", + "subnetMask": "255.255.255.0", + "networkAddress": "192.168.1.0", + "broadcastAddress": "192.168.1.255" + } + ] + }, + "status": "ok" +} +``` + +### Get DHCP Scope + +Gets the complete details of the scope configuration. + +URL: +`http://localhost:5380/api/dhcp/scopes/get?token=x&name=Default` + +OBSOLETE PATH: +`/api/getDhcpScope` + +PERMISSIONS: +DhcpServer: View + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. + +RESPONSE: +``` +{ + "response": { + "name": "Default", + "startingAddress": "192.168.1.1", + "endingAddress": "192.168.1.254", + "subnetMask": "255.255.255.0", + "leaseTimeDays": 7, + "leaseTimeHours": 0, + "leaseTimeMinutes": 0, + "offerDelayTime": 0, + "pingCheckEnabled": false, + "pingCheckTimeout": 1000, + "pingCheckRetries": 2, + "domainName": "local", + "dnsTtl": 900, + "serverAddress": "192.168.1.1", + "serverHostName": "tftp-server-1", + "bootFileName": "boot.bin", + "routerAddress": "192.168.1.1", + "useThisDnsServer": false, + "dnsServers": [ + "192.168.1.5" + ], + "winsServers": [ + "192.168.1.5" + ], + "ntpServers": [ + "192.168.1.5" + ], + "staticRoutes": [ + { + "destination": "172.16.0.0", + "subnetMask": "255.255.255.0", + "router": "192.168.1.2" + } + ], + "vendorInfo": [ + { + "identifier": "substring(vendor-class-identifier,0,9)==\"PXEClient\"", + "information": "06:01:03:0A:04:00:50:58:45:09:14:00:00:11:52:61:73:70:62:65:72:72:79:20:50:69:20:42:6F:6F:74:FF" + } + ], + "exclusions": [ + { + "startingAddress": "192.168.1.1", + "endingAddress": "192.168.1.10" + } + ], + "reservedLeases": [ + { + "hostName": null, + "hardwareAddress": "00-00-00-00-00-00", + "address": "192.168.1.10", + "comments": "comments" + } + ], + "allowOnlyReservedLeases": false + }, + "status": "ok" +} +``` + +### Set DHCP Scope + +Sets the DHCP scope configuration. + +URL: +`http://localhost:5380/api/dhcp/scopes/set?token=x&name=Default&startingAddress=192.168.1.1&endingAddress=192.168.1.254&subnetMask=255.255.255.0&leaseTimeDays=7&leaseTimeHours=0&leaseTimeMinutes=0&offerDelayTime=0&domainName=local&dnsTtl=900&serverAddress=&serverHostName=&bootFileName=&routerAddress=192.168.1.1&useThisDnsServer=false&dnsServers=192.168.1.5&winsServers=192.168.1.5&ntpServers=192.168.1.5&staticRoutes=172.16.0.0|255.255.255.0|192.168.1.2&exclusions=192.168.1.1|192.168.1.10&reservedLeases=hostname|00-00-00-00-00-00|192.168.1.10|comments&allowOnlyReservedLeases=false` + +OBSOLETE PATH: +`/api/setDhcpScope` + +PERMISSIONS: +DhcpServer: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. +- `newName` (optional): The new name of the DHCP scope to rename an existing scope. +- `startingAddress` (optional): The starting IP address of the DHCP scope. This parameter is required when creating a new scope. +- `endingAddress` (optional): The ending IP address of the DHCP scope. This parameter is required when creating a new scope. +- `subnetMask` (optional): The subnet mask of the network. This parameter is required when creating a new scope. +- `leaseTimeDays` (optional): The lease time in number of days. +- `leaseTimeHours` (optional): The lease time in number of hours. +- `leaseTimeMinutes` (optional): The lease time in number of minutes. +- `offerDelayTime` (optional): The time duration in milli seconds that the DHCP server delays sending an DHCPOFFER message. +- `pingCheckEnabled` (optional): Set this option to `true` to allow the DHCP server to find out if an IP address is already in use to prevent IP address conflict when some of the devices on the network have manually configured IP addresses. +- `pingCheckTimeout` (optional): The timeout interval to wait for an ping reply. +- `pingCheckRetries` (optional): The maximum number of ping requests to try. +- `domainName` (optional): The domain name to be used by this network. The DHCP server automatically adds forward and reverse DNS entries for each IP address allocations when domain name is configured. +- `dnsTtl` (optional): The TTL value used for forward and reverse DNS records. +- `serverAddress` (optional): The bootstrap TFTP server IP address to be used by the clients. If not specified, the DHCP server's IP address is used. +- `serverHostName` (optional): The optional bootstrap TFTP server host name to be used by the clients to identify the TFTP server. +- `bootFileName` (optional): The boot file name stored on the bootstrap TFTP server to be used by the clients. +- `routerAddress` (optional): The default gateway or router IP address to be used by the clients. +- `useThisDnsServer` (optional): Tells the DHCP server to use this DNS server's IP address to configure the DNS Servers DHCP option for clients. +- `dnsServers` (optional): A comma separated list of DNS server IP addresses to be used by the clients. This parameter is ignored when `useThisDnsServer` is set to `true`. +- `winsServers` (optional): A comma separated list of NBNS/WINS server IP addresses to be used by the clients. +- `ntpServers` (optional): A comma separated list of Network Time Protocol (NTP) server IP addresses to be used by the clients. +- `staticRoutes` (optional): A `|` separated list of static routes in format `{destination network address}|{subnet mask}|{router/gateway address}` to be used by the clients for accessing specified destination networks. +- `vendorInfo` (optional): A `|` separated list of vendor information in format `{vendor class identifier}|{vendor specific information}` where `{vendor specific information}` is a colon separated hex string. +- `exclusions` (optional): A `|` separated list of IP address range in format `{starting address}|{ending address}` that must be excluded or not assigned dynamically to any client by the DHCP server. +- `reservedLeases` (optional): A `|` separated list of reserved IP addresses in format `{host name}|{MAC address}|{reserved IP address}|{comments}` to be assigned to specific clients based on their MAC address. +- `allowOnlyReservedLeases` (optional): Set this parameter to `true` to stop dynamic IP address allocation and allocate only reserved IP addresses. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### Add Reserved Lease + +Adds a reserved lease entry to the specified scope. + +URL: +`http://localhost:5380/api/dhcp/scopes/addReservedLease?token=x` + +PERMISSIONS: +DhcpServer: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. +- `hardwareAddress`: The MAC address of the client. +- `ipAddress`: The reserved IP address for the client. +- `hostName` (optional): The hostname of the client to override. +- `comments` (optional): Comments for the reserved lease entry. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### Remove Reserved Lease + +Removed a reserved lease entry from the specified scope. + +URL: +`http://localhost:5380/api/dhcp/scopes/removeReservedLease?token=x` + +PERMISSIONS: +DhcpServer: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. +- `hardwareAddress`: The MAC address of the client. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### Enable DHCP Scope + +Enables the DHCP scope allowing the server to allocate leases. + +URL: +`http://localhost:5380/api/dhcp/scopes/enable?token=x&name=Default` + +OBSOLETE PATH: +`/api/enableDhcpScope` + +PERMISSIONS: +DhcpServer: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### Disable DHCP Scope + +Disables the DHCP scope and stops any further lease allocations. + +URL: +`http://localhost:5380/api/dhcp/scopes/disable?token=x&name=Default` + +OBSOLETE PATH: +`/api/disableDhcpScope` + +PERMISSIONS: +DhcpServer: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### Delete DHCP Scope + +Permanently deletes the DHCP scope from the disk. + +URL: +`http://localhost:5380/api/dhcp/scopes/delete?token=x&name=Default` + +OBSOLETE PATH: +`/api/deleteDhcpScope` + +PERMISSIONS: +DhcpServer: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `name`: The name of the DHCP scope. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +## Administration API Calls + +Allows managing the DNS server administration which includes managing all sessions, users, groups, and permissions. + +### List Sessions + +Returns a list of active user sessions. + +URL: +`http://localhost:5380/api/admin/sessions/list?token=x` + +PERMISSIONS: +Administration: View + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "response": { + "sessions": [ + { + "username": "admin", + "isCurrentSession": true, + "partialToken": "272f4890427b9ab5", + "type": "Standard", + "tokenName": null, + "lastSeen": "2022-09-17T13:23:44.9972772Z", + "lastSeenRemoteAddress": "127.0.0.1", + "lastSeenUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0" + }, + { + "username": "admin", + "isCurrentSession": false, + "partialToken": "ddfaecb8e9325e77", + "type": "ApiToken", + "tokenName": "MyToken1", + "lastSeen": "2022-09-17T13:22:45.6710766Z", + "lastSeenRemoteAddress": "127.0.0.1", + "lastSeenUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0" + } + ] + }, + "status": "ok" +} +``` + +### Create API Token + +Allows creating a non-expiring API token that can be used with automation scripts to make API calls. The token allows access to API calls with the same privileges as that of the user and thus its advised to create a separate user with limited permissions required for creating the API token. The token cannot be used to change the user's password, or update the user profile details. + +URL: +`http://localhost:5380/api/admin/sessions/createToken?token=x&user=admin&tokenName=MyToken1` + +PERMISSIONS: +Administration: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `user`: The username for the user account for which to generate the API token. +- `tokenName`: The name of the created token to identify its session. + +RESPONSE: +``` +{ + "response": { + "username": "admin", + "tokenName": "MyToken1", + "token": "ddfaecb8e9325e77865ee7e100f89596a65d3eae0e6dddcb33172355b95a64af" + }, + "status": "ok" +} +``` + +### Delete Session + +Deletes a specified user's session. + +URL: +`http://localhost:5380/api/admin/sessions/delete?token=x&partialToken=ddfaecb8e9325e77` + +PERMISSIONS: +Administration: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `partialToken`: The partial token of the session to delete that was returned by the list of sessions. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### List Users + +Returns a list of all users. + +URL: +`http://localhost:5380/api/admin/users/list?token=x` + +PERMISSIONS: +Administration: View + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "response": { + "users": [ + { + "displayName": "Administrator", + "username": "admin", + "disabled": false, + "previousSessionLoggedOn": "2022-09-17T13:20:32.7933783Z", + "previousSessionRemoteAddress": "127.0.0.1", + "recentSessionLoggedOn": "2022-09-17T13:22:45.671081Z", + "recentSessionRemoteAddress": "127.0.0.1" + }, + { + "displayName": "Shreyas Zare", + "username": "shreyas", + "disabled": false, + "previousSessionLoggedOn": "0001-01-01T00:00:00Z", + "previousSessionRemoteAddress": "0.0.0.0", + "recentSessionLoggedOn": "0001-01-01T00:00:00Z", + "recentSessionRemoteAddress": "0.0.0.0" + } + ] + }, + "status": "ok" +} +``` + +### Create User + +Creates a new user account. + +URL: +`http://localhost:5380/api/admin/users/create?token=x&displayName=User&user=user1&pass=password` + +PERMISSIONS: +Administration: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `user`: A unique username for the user account. +- `pass`: A password for the user account. +- `displayName` (optional): The display name for the user account. + +RESPONSE: +``` +{ + "response": { + "displayName": "User", + "username": "user1", + "disabled": false, + "previousSessionLoggedOn": "0001-01-01T00:00:00", + "previousSessionRemoteAddress": "0.0.0.0", + "recentSessionLoggedOn": "0001-01-01T00:00:00", + "recentSessionRemoteAddress": "0.0.0.0" + }, + "status": "ok" +} +``` + +### Get User Details + +Returns a user account profile details. + +URL: +`http://localhost:5380/api/admin/users/get?token=x&user=admin&includeGroups=true + +PERMISSIONS: +Administration: View + +WHERE: +- `token`: The session token generated by the `login` call. +- `user`: The username for the user account. +- `includeGroups` (optional): Set `true` to include a list of groups in response. + +RESPONSE: +``` +{ + "response": { + "displayName": "Administrator", + "username": "admin", + "disabled": false, + "previousSessionLoggedOn": "2022-09-16T13:22:45.671Z", + "previousSessionRemoteAddress": "127.0.0.1", + "recentSessionLoggedOn": "2022-09-18T09:55:26.9800695Z", + "recentSessionRemoteAddress": "127.0.0.1", + "sessionTimeoutSeconds": 1800, + "memberOfGroups": [ + "Administrators" + ], + "sessions": [ + { + "username": "admin", + "isCurrentSession": false, + "partialToken": "1f8011516cea27af", + "type": "Standard", + "tokenName": null, + "lastSeen": "2022-09-18T09:55:40.6519988Z", + "lastSeenRemoteAddress": "127.0.0.1", + "lastSeenUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0" + }, + { + "username": "admin", + "isCurrentSession": false, + "partialToken": "ddfaecb8e9325e77", + "type": "ApiToken", + "tokenName": "MyToken1", + "lastSeen": "2022-09-17T13:22:45.671Z", + "lastSeenRemoteAddress": "127.0.0.1", + "lastSeenUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0" + } + ], + "groups": [ + "Administrators", + "DHCP Administrators", + "DNS Administrators" + ] + }, + "status": "ok" +} +``` + +### Set User Details + +Allows changing user account profile details. + +URL: +`http://localhost:5380/api/admin/users/set?token=x&user=admin&displayName=Administrator&disabled=false&sessionTimeoutSeconds=1800&memberOfGroups=Administrators` + +PERMISSIONS: +Administration: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `user`: The username for the user account. +- `displayName` (optional): The display name for the user account. +- `newUser` (optional): A new username for renaming the username for the user account. +- `disabled` (optional): Set `true` to disable the user account and delete all its active sessions. +- `sessionTimeoutSeconds` (optional): A session time out value in seconds for the user account. +- `newPass` (optional): A new password to reset the user account password. +- `iterations` (optional): The number of iterations for PBKDF2 SHA256 password hashing. This is only used with the `newPass` option. +- `memberOfGroups` (optional): A list of comma separated group names that the user must be set as a member. + +RESPONSE: +``` +{ + "response": { + "displayName": "Administrator", + "username": "admin", + "disabled": false, + "previousSessionLoggedOn": "2022-09-17T13:22:45.671Z", + "previousSessionRemoteAddress": "127.0.0.1", + "recentSessionLoggedOn": "2022-09-18T09:55:26.9800695Z", + "recentSessionRemoteAddress": "127.0.0.1", + "sessionTimeoutSeconds": 1800, + "memberOfGroups": [ + "Administrators" + ], + "sessions": [ + { + "username": "admin", + "isCurrentSession": false, + "partialToken": "1f8011516cea27af", + "type": "Standard", + "tokenName": null, + "lastSeen": "2022-09-18T09:59:19.9034491Z", + "lastSeenRemoteAddress": "127.0.0.1", + "lastSeenUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0" + }, + { + "username": "admin", + "isCurrentSession": false, + "partialToken": "ddfaecb8e9325e77", + "type": "ApiToken", + "tokenName": "MyToken1", + "lastSeen": "2022-09-17T13:22:45.671Z", + "lastSeenRemoteAddress": "127.0.0.1", + "lastSeenUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0" + } + ] + }, + "status": "ok" +} +``` + +### Delete User + +Deletes a user account. + +URL: +`http://localhost:5380/api/admin/users/delete?token=x&user=user1` + +PERMISSIONS: +Administration: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `user`: The username for the user account to delete. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### List Groups + +Returns a list of all groups. + +URL: +`http://localhost:5380/api/admin/groups/list?token=x` + +PERMISSIONS: +Administration: View + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "response": { + "groups": [ + { + "name": "Administrators", + "description": "Super administrators" + }, + { + "name": "DHCP Administrators", + "description": "DHCP service administrators" + }, + { + "name": "DNS Administrators", + "description": "DNS service administrators" + } + ] + }, + "status": "ok" +} +``` + +### Create Group + +Creates a new group. + +URL: +`http://localhost:5380/api/admin/groups/create?token=x&group=Group1&description=My%20description` + +PERMISSIONS: +Administration: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `group`: The name of the group to create. +- `description` (optional): The description text for the group. + +RESPONSE: +``` +{ + "response": { + "name": "Group1", + "description": "My description" + }, + "status": "ok" +} +``` + +### Get Group Details + +Returns the details for a group. + +URL: +`http://localhost:5380/api/admin/groups/get?token=x&group=Administrators&includeUsers=true` + +PERMISSIONS: +Administration: View + +WHERE: +- `token`: The session token generated by the `login` call. +- `group`: The name of the group. +- `includeUsers` (optional): Set `true` to include a list of users in response. + +RESPONSE: +``` +{ + "response": { + "name": "Administrators", + "description": "Super administrators", + "members": [ + "admin" + ], + "users": [ + "admin", + "shreyas" + ] + }, + "status": "ok" +} +``` + +### Set Group Details + +Allows changing group description or rename a group. + +URL: +`http://localhost:5380/api/admin/groups/set?token=x&group=Administrators&description=Super%20administrators&members=admin` + +PERMISSIONS: +Administration: Modify + +WHERE: +- `token`: The session token generated by the `login` call. +- `group`: The name of the group to update. +- `newGroup` (optional): A new group name to rename the group. +- `description` (optional): A new group description. +- `members` (optional): A comma separated list of usernames to set as the group's members. + +RESPONSE: +``` +{ + "response": { + "name": "Administrators", + "description": "Super administrators", + "members": [ + "admin" + ] + }, + "status": "ok" +} +``` + +### Delete Group + +Allows deleting a group. + +URL: +`http://localhost:5380/api/admin/groups/delete?token=x&group=Group1` + +PERMISSIONS: +Administration: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `group`: The name of the group to delete. + +RESPONSE: +``` +{ + "response": {}, + "status": "ok" +} +``` + +### List Permissions + +URL: +`http://localhost:5380/api/admin/permissions/list?token=x` + +PERMISSIONS: +Administration: View + +WHERE: +- `token`: The session token generated by the `login` call. + +RESPONSE: +``` +{ + "response": { + "permissions": [ + { + "section": "Dashboard", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + }, + { + "section": "Zones", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DHCP Administrators", + "canView": true, + "canModify": false, + "canDelete": false + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + }, + { + "section": "Cache", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + }, + { + "section": "Allowed", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + }, + { + "section": "Blocked", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + }, + { + "section": "Apps", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + }, + { + "section": "DnsClient", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DHCP Administrators", + "canView": true, + "canModify": false, + "canDelete": false + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + }, + { + "section": "Settings", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": true, + "canDelete": true + } + ] + }, + { + "section": "DhcpServer", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DHCP Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + }, + { + "section": "Administration", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + } + ] + }, + { + "section": "Logs", + "userPermissions": [], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "DHCP Administrators", + "canView": true, + "canModify": false, + "canDelete": false + }, + { + "name": "DNS Administrators", + "canView": true, + "canModify": false, + "canDelete": false + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + } + ] + }, + "status": "ok" +} +``` + +### Get Permission Details + +Gets details of the permissions for the specified section. + +URL: +`http://localhost:5380/api/admin/permissions/get?token=x§ion=Dashboard&includeUsersAndGroups=true` + +PERMISSIONS: +Administration: View + +WHERE: +- `token`: The session token generated by the `login` call. +- `section`: The name of the section as given in the list of permissions API call. +- `includeUsersAndGroups` (optional): Set to `true` to include a list of users and groups in the response. + +RESPONSE: +``` +{ + "response": { + "section": "Dashboard", + "userPermissions": [ + { + "username": "shreyas", + "canView": true, + "canModify": false, + "canDelete": false + } + ], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ], + "users": [ + "admin", + "shreyas" + ], + "groups": [ + "Administrators", + "DHCP Administrators", + "DNS Administrators", + "Everyone" + ] + }, + "status": "ok" +} +``` + +### Set Permission Details + +Allows changing permissions for the specified section. + +URL: +`http://localhost:5380/api/admin/permissions/set?token=x§ion=Dashboard&userPermissions=shreyas|true|false|false&groupPermissions=Administrators|true|true|true|Everyone|true|false|false` + +PERMISSIONS: +Administration: Delete + +WHERE: +- `token`: The session token generated by the `login` call. +- `section`: The name of the section as given in the list of permissions API call. +- `userPermissions` (optional): A pipe `|` separated table data with each row containing username and boolean values for the view, modify and delete permissions. For example: user1|true|true|true|user2|true|false|false +- `groupPermissions` (optional): A pipe `|` separated table data with each row containing the group name and boolean values for the view, modify and delete permissions. For example: group1|true|true|true|group2|true|true|false + +RESPONSE: +``` +{ + "response": { + "section": "Dashboard", + "userPermissions": [ + { + "username": "shreyas", + "canView": true, + "canModify": false, + "canDelete": false + } + ], + "groupPermissions": [ + { + "name": "Administrators", + "canView": true, + "canModify": true, + "canDelete": true + }, + { + "name": "Everyone", + "canView": true, + "canModify": false, + "canDelete": false + } + ] + }, + "status": "ok" +} +``` + ## Log API Calls ### List Logs @@ -3415,7 +5540,13 @@ RESPONSE: Lists all logs files available on the DNS server. URL: -`http://localhost:5380/api/listLogs?token=x` +`http://localhost:5380/api/logs/list?token=x` + +OBSOLETE PATH: +`/api/listLogs` + +PERMISSIONS: +Logs: View WHERE: - `token`: The session token generated by the `login` call. @@ -3456,11 +5587,17 @@ RESPONSE: Downloads the log file. URL: -`http://localhost:5380/log/{fileName}?token=x&limit=2` +`http://localhost:5380/api/logs/download?token=x&fileName=2020-09-10&limit=2` + +OBSOLETE PATH: +`/log/{fileName}` + +PERMISSIONS: +Logs: View WHERE: -- `{fileName}`: The `fileName` returned by the List Logs API call. - `token`: The session token generated by the `login` call. +- `fileName`: The `fileName` returned by the List Logs API call. - `limit` (optional): The limit of number of mega bytes to download the log file. Default value is `0` when parameter is missing which indicates there is no limit. RESPONSE: @@ -3468,10 +5605,16 @@ Response is a downloadable file with `Content-Type: text/plain` and `Content-Dis ### Delete Log -Permanantly deletes a log file from the disk. +Permanently deletes a log file from the disk. URL: -`http://localhost:5380/api/deleteLog?token=x&log=2020-09-19` +`http://localhost:5380/api/logs/delete?token=x&log=2020-09-19` + +OBSOLETE PATH: +`/api/deleteLog` + +PERMISSIONS: +Logs: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -3487,28 +5630,16 @@ RESPONSE: ### Delete All Logs -Permanantly delete all log files from the disk. +Permanently delete all log files from the disk. URL: -`http://localhost:5380/api/deleteAllLogs?token=x` +`http://localhost:5380/api/logs/deleteAll?token=x` -WHERE: -- `token`: The session token generated by the `login` call. +OBSOLETE PATH: +`/api/deleteAllLogs` -RESPONSE: -``` -{ - "response": {}, - "status": "ok" -} -``` - -### Delete All Stats - -Permanantly delete all hourly and daily stats files from the disk and clears all stats stored in memory. This call will clear all stats from the Dashboard. - -URL: -`http://localhost:5380/api/deleteAllStats?token=x` +PERMISSIONS: +Logs: Delete WHERE: - `token`: The session token generated by the `login` call. @@ -3526,7 +5657,13 @@ RESPONSE: Queries for logs to a specified DNS app. URL: -`http://localhost:5380/api/queryLogs?token=x&name=AppName&classPath=AppClassPath&=pageNumber=1&entriesPerPage=10&descendingOrder=true&start=yyyy-MM-dd HH:mm:ss&end=yyyy-MM-dd HH:mm:ss&clientIpAddress=&protocol=&responseType=&rcode=&qname=&qtype=&qclass=` +`http://localhost:5380/api/logs/query?token=x&name=AppName&classPath=AppClassPath&=pageNumber=1&entriesPerPage=10&descendingOrder=true&start=yyyy-MM-dd HH:mm:ss&end=yyyy-MM-dd HH:mm:ss&clientIpAddress=&protocol=&responseType=&rcode=&qname=&qtype=&qclass=` + +OBSOLETE PATH: +`/api/queryLogs` + +PERMISSIONS: +Logs: View WHERE: - `token`: The session token generated by the `login` call. @@ -3678,326 +5815,3 @@ RESPONSE: "status": "ok" } ``` - -## DHCP API Calls - -### List DHCP Scopes - -Lists all the DHCP scopes available on the server. - -URL: -`http://localhost:5380/api/listDhcpScopes?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -RESPONSE: -``` -{ - "response": { - "scopes": [ - { - "name": "Default", - "enabled": false, - "startingAddress": "192.168.1.1", - "endingAddress": "192.168.1.254", - "subnetMask": "255.255.255.0", - "networkAddress": "192.168.1.0", - "broadcastAddress": "192.168.1.255" - } - ] - }, - "status": "ok" -} -``` - -### List DHCP Leases - -Lists all the DHCP leases. - -URL: -`http://localhost:5380/api/listDhcpLeases?token=x` - -WHERE: -- `token`: The session token generated by the `login` call. - -RESPONSE: -``` -{ - "response": { - "leases": [ - { - "scope": "Default", - "type": "Reserved", - "hardwareAddress": "00-00-00-00-00-00", - "clientIdentifier": "1-000000000000", - "address": "192.168.1.5", - "hostName": "server1.local", - "leaseObtained": "08/25/2020 17:52:51", - "leaseExpires": "09/26/2020 14:27:12" - }, - { - "scope": "Default", - "type": "Dynamic", - "hardwareAddress": "00-00-00-00-00-00", - "clientIdentifier": "1-000000000000", - "address": "192.168.1.13", - "hostName": null, - "leaseObtained": "06/15/2020 16:41:46", - "leaseExpires": "09/25/2020 12:39:54" - }, - { - "scope": "Default", - "type": "Dynamic", - "hardwareAddress": "00-00-00-00-00-00", - "clientIdentifier": "1-000000000000", - "address": "192.168.1.15", - "hostName": "desktop-ea2miaf.local", - "leaseObtained": "06/18/2020 12:19:03", - "leaseExpires": "09/25/2020 12:17:11" - }, - ] - }, - "status": "ok" -} -``` - -### Get DHCP Scope - -Gets the complete details of the scope configuration. - -URL: -`http://localhost:5380/api/getDhcpScope?token=x&name=Default` - -WHERE: -- `token`: The session token generated by the `login` call. -- `name`: The name of the DHCP scope. - -RESPONSE: -``` -{ - "response": { - "name": "Default", - "startingAddress": "192.168.1.1", - "endingAddress": "192.168.1.254", - "subnetMask": "255.255.255.0", - "leaseTimeDays": 7, - "leaseTimeHours": 0, - "leaseTimeMinutes": 0, - "offerDelayTime": 0, - "pingCheckEnabled": false, - "pingCheckTimeout": 1000, - "pingCheckRetries": 2, - "domainName": "local", - "dnsTtl": 900, - "serverAddress": "192.168.1.1", - "serverHostName": "tftp-server-1", - "bootFileName": "boot.bin", - "routerAddress": "192.168.1.1", - "useThisDnsServer": false, - "dnsServers": [ - "192.168.1.5" - ], - "winsServers": [ - "192.168.1.5" - ], - "ntpServers": [ - "192.168.1.5" - ], - "staticRoutes": [ - { - "destination": "172.16.0.0", - "subnetMask": "255.255.255.0", - "router": "192.168.1.2" - } - ], - "vendorInfo": [ - { - "identifier": "substring(vendor-class-identifier,0,9)==\"PXEClient\"", - "information": "06:01:03:0A:04:00:50:58:45:09:14:00:00:11:52:61:73:70:62:65:72:72:79:20:50:69:20:42:6F:6F:74:FF" - } - ], - "exclusions": [ - { - "startingAddress": "192.168.1.1", - "endingAddress": "192.168.1.10" - } - ], - "reservedLeases": [ - { - "hostName": null, - "hardwareAddress": "00-00-00-00-00-00", - "address": "192.168.1.10", - "comments": "comments" - } - ], - "allowOnlyReservedLeases": false - }, - "status": "ok" -} -``` - -### Set DHCP Scope - -Sets the DHCP scope configuration. - -URL: -`http://localhost:5380/api/setDhcpScope?token=x&name=Default&startingAddress=192.168.1.1&endingAddress=192.168.1.254&subnetMask=255.255.255.0&leaseTimeDays=7&leaseTimeHours=0&leaseTimeMinutes=0&offerDelayTime=0&domainName=local&dnsTtl=900&serverAddress=&serverHostName=&bootFileName=&routerAddress=192.168.1.1&useThisDnsServer=false&dnsServers=192.168.1.5&winsServers=192.168.1.5&ntpServers=192.168.1.5&staticRoutes=172.16.0.0|255.255.255.0|192.168.1.2&exclusions=192.168.1.1|192.168.1.10&reservedLeases=hostname|00-00-00-00-00-00|192.168.1.10|comments&allowOnlyReservedLeases=false` - -WHERE: -- `token`: The session token generated by the `login` call. -- `name`: The name of the DHCP scope. -- `newName` (optional): The new name of the DHCP scope to rename an existing scope. -- `startingAddress` (optional): The starting IP address of the DHCP scope. This parameter is required when creating a new scope. -- `endingAddress` (optional): The ending IP address of the DHCP scope. This parameter is required when creating a new scope. -- `subnetMask` (optional): The subnet mask of the network. This parameter is required when creating a new scope. -- `leaseTimeDays` (optional): The lease time in number of days. -- `leaseTimeHours` (optional): The lease time in number of hours. -- `leaseTimeMinutes` (optional): The lease time in number of minutes. -- `offerDelayTime` (optional): The time duration in milli seconds that the DHCP server delays sending an DHCPOFFER message. -- `pingCheckEnabled` (optional): Set this option to `true` to allow the DHCP server to find out if an IP address is already in use to prevent IP address conflict when some of the devices on the network have manually configured IP addresses. -- `pingCheckTimeout` (optional): The timeout interval to wait for an ping reply. -- `pingCheckRetries` (optional): The maximum number of ping requests to try. -- `domainName` (optional): The domain name to be used by this network. The DHCP server automatically adds forward and reverse DNS entries for each IP address allocations when domain name is configured. -- `dnsTtl` (optional): The TTL value used for forward and reverse DNS records. -- `serverAddress` (optional): The bootstrap TFTP server IP address to be used by the clients. If not specified, the DHCP server's IP address is used. -- `serverHostName` (optional): The optional bootstrap TFTP server host name to be used by the clients to identify the TFTP server. -- `bootFileName` (optional): The boot file name stored on the bootstrap TFTP server to be used by the clients. -- `routerAddress` (optional): The default gateway or router IP address to be used by the clients. -- `useThisDnsServer` (optional): Tells the DHCP server to use this DNS server's IP address to configure the DNS Servers DHCP option for clients. -- `dnsServers` (optional): A comma separated list of DNS server IP addresses to be used by the clients. This parameter is ignored when `useThisDnsServer` is set to `true`. -- `winsServers` (optional): A comma separated list of NBNS/WINS server IP addresses to be used by the clients. -- `ntpServers` (optional): A comma separated list of Network Time Protocol (NTP) server IP addresses to be used by the clients. -- `staticRoutes` (optional): A `|` separated list of static routes in format `{destination network address}|{subnet mask}|{router/gateway address}` to be used by the clients for accessing specified destination networks. -- `vendorInfo` (optional): A `|` separated list of vendor information in format `{vendor class identifier}|{vendor specific information}` where `{vendor specific information}` is a colon separated hex string. -- `exclusions` (optional): A `|` separated list of IP address range in format `{starting address}|{ending address}` that must be excluded or not assigned dynamically to any client by the DHCP server. -- `reservedLeases` (optional): A `|` separated list of reserved IP addresses in format `{host name}|{MAC address}|{reserved IP address}|{comments}` to be assigned to specific clients based on their MAC address. -- `allowOnlyReservedLeases` (optional): Set this parameter to `true` to stop dynamic IP address allocation and allocate only reserved IP addresses. - -RESPONSE: -``` -{ - "response": {}, - "status": "ok" -} -``` - -### Enable DHCP Scope - -Enables the DHCP scope allowing the server to allocate leases. - -URL: -`http://localhost:5380/api/enableDhcpScope?token=x&name=Default` - -WHERE: -- `token`: The session token generated by the `login` call. -- `name`: The name of the DHCP scope. - -RESPONSE: -``` -{ - "response": {}, - "status": "ok" -} -``` - -### Disable DHCP Scope - -Disables the DHCP scope and stops any further lease allocations. - -URL: -`http://localhost:5380/api/disableDhcpScope?token=x&name=Default` - -WHERE: -- `token`: The session token generated by the `login` call. -- `name`: The name of the DHCP scope. - -RESPONSE: -``` -{ - "response": {}, - "status": "ok" -} -``` - -### Delete DHCP Scope - -Permanently deletes the DHCP scope from the disk. - -URL: -`http://localhost:5380/api/deleteDhcpScope?token=x&name=Default` - -WHERE: -- `token`: The session token generated by the `login` call. -- `name`: The name of the DHCP scope. - -RESPONSE: -``` -{ - "response": {}, - "status": "ok" -} -``` - -### Remove DHCP Lease - -Removes a dynamic or reserved lease allocation. This API must be used carefully to make sure that there is no IP address conflict caused by removing a lease. - -URL: -`http://localhost:5380/api/removeDhcpLease?token=x&name=Default&hardwareAddress=00:00:00:00:00:00` - -WHERE: -- `token`: The session token generated by the `login` call. -- `name`: The name of the DHCP scope. -- `clientIdentifier` (optional): The client identifier for the lease. Either `hardwareAddress` or `clientIdentifier` must be specified. -- `hardwareAddress` (optional): The MAC address of the device bearing the dynamic/reserved lease. Either `hardwareAddress` or `clientIdentifier` must be specified. - -RESPONSE: -``` -{ - "response": {}, - "status": "ok" -} -``` - -### Convert To Reserved Lease - -Converts a dynamic lease to reserved lease. - -URL: -`http://localhost:5380/api/convertToReservedLease?token=x&name=Default&hardwareAddress=00:00:00:00:00:00` - -WHERE: -- `token`: The session token generated by the `login` call. -- `name`: The name of the DHCP scope. -- `clientIdentifier` (optional): The client identifier for the lease. Either `hardwareAddress` or `clientIdentifier` must be specified. -- `hardwareAddress` (optional): The MAC address of the device bearing the dynamic lease. Either `hardwareAddress` or `clientIdentifier` must be specified. - -RESPONSE: -``` -{ - "response": {}, - "status": "ok" -} -``` - -### Convert To Dynamic Lease - -Converts a reserved lease to dynamic lease. - -URL: -`http://localhost:5380/api/convertToDynamicLease?token=x&name=Default&hardwareAddress=00:00:00:00:00:00` - -WHERE: -- `token`: The session token generated by the `login` call. -- `name`: The name of the DHCP scope. -- `clientIdentifier` (optional): The client identifier for the lease. Either `hardwareAddress` or `clientIdentifier` must be specified. -- `hardwareAddress` (optional): The MAC address of the device bearing the reserved lease. Either `hardwareAddress` or `clientIdentifier` must be specified. - -RESPONSE: -``` -{ - "response": {}, - "status": "ok" -} -``` \ No newline at end of file