# Pdns-PhpApi
PHP RESTful API for PowerDNS, (*1)
Usage
The following shows how to call the API. Pdns-PhpApi adheres to the RESTful practice of ustilizing POST, PUT, DELETE and GET., (*2)
The default username/password is admin/foo., (*3)
Domain Actions
The following calls are for adding/editing/deleting domain information. Primary key is the domain name., (*4)
List Domains
Returns all the domains, but does not include their records., (*5)
GET /domain/ HTTP/1.1, (*6)
Get Domain Info
Returns all the domain information for the specified domain, including records associated with that domain., (*7)
GET /domain/<domain.com> HTTP/1.1, (*8)
Create Domain Record
Creates a domain record, (*9)
POST /domain HTTP/1.1, (*10)
Parameters
- domain : domain name of the new record [Required]
- type : type of the new record, either MASTER or SLAVE [Optional] [Default MASTER]
- master : master record if type is SLAVE [Optional] [Default null], (*11)
Update Domain Record
Updates a domain record, (*12)
POST /domain HTTP/1.1, (*13)
Parameters
- domain : domain name of the new record [Optional] [Default null]
- type : type of the new record, either MASTER or SLAVE [Optional] [Default MASTER]
- master : master record if type is SLAVE [Optional] [Default null], (*14)
Delete Domain Info
Deletes the specified domain and all associated records, (*15)
DELETE /domain/<domain.com> HTTP/1.1, (*16)
Record Actions
The following calls are for add/editing/deleting/listing records for the domain. Primary key is the record id., (*17)
Get Record Info
Returns the record information for the specified name, for example ns1.mydomain.com. Key can also be the id
of the record you want information for., (*18)
GET /record/<key> HTTP/1.1, (*19)
Get Record Info For Domain and Type
Returns the record information for the specified domain and type. For example to list all NS records for a domain, (*20)
GET /record/<domain>/<type> HTTP/1.1, (*21)
Create Record
Creates a record for a domain, (*22)
POST /record HTTP/1.1, (*23)
Parameters
- domain : domain name for the record [Required]
- name : name of the record [Required]
- type : type of the record [Required]
- content : content of the record [Required]
- ttl : time to live [Optional] [Default 3600]
- prio : priority of the record [Optional], (*24)
Update Record
Updates a record for the id specified., (*25)
PUT /record/<id> HTTP/1.1, (*26)
Parameters
- name : name of the record [Required]
- type : type of the record [Required]
- content : content of the record [Required]
- ttl : time to live [Optional] [Default 3600]
- prio : priority of the record [Optional], (*27)
Delete Info
Deletes the specified record, (*28)
DELETE /record/<id> HTTP/1.1, (*29)