Draft 20 version of DNS API » History » Revision 18
Revision 17 (Brian Gupta, 05/10/2011 01:43 AM) → Revision 18/20 (Brian Gupta, 05/11/2011 10:16 AM)
h1. Draft 20 version of DNS API, with working notes h2. Current API |_.DNS | |/dns|POST|Create a new DNS record|@{"fqdn":string(name/ip), "value":string(ip/reverse), "type":string(A/PTR)}@| |/dns/value|DELETE|remove value(ip or reverse) DNS record|| h2. Record types h3. Should be implemented in next version of DNS API |_.Path|_.REST Type|_.Description|_.Example Input JSON|_.Notes| |/dns|GET|List of DNS zones managed by the proxy||| |/dns/zone|GET|List all zone records||| |/dns/zone/A|GET/PUT/POST/DELETE|A |/dns/zone/A|GET/POST/DELETE|A Record - Name to IPv4 address|@{"fqdn":string(name), "value":string(ip), "type":string(A)}@|Supports multiple records| |/dns/zone/PTR|GET/PUT/POST/DELETE|PTR |/dns/zone/PTR|GET/POST/DELETE|PTR - Reverse record, IP address to Name|@{"fqdn":string(ip/ipv6), "value":string(name), "type":string(PTR)}@|Does not support multiple records| |/dns/zone/CNAME|GET/PUT/POST/DELETE|CNAME |/dns/zone/CNAME|GET/POST/DELETE|CNAME - DNS Alias|@{"fqdn":string(name), "value":string(name), "type":string(CNAME)}@|Bind 9 doesn't support roundrobin cnames, so we should at first limit CNAMEs to a single record| |/dns/zone/AAAA|GET/PUT/POST/DELETE|IPv6 |/dns/zone/AAAA|GET/POST/DELETE|IPv6 A Record - Name to IPv6 address|@{"fqdn":string(ipv6), "value":string(name), "type":string(AAAA)}@|IPv6 address, supports multiple records| |/dns/zone/TXT|GET/PUT/POST/DELETE|TXT |/dns/zone/TXT|GET/POST/DELETE|TXT - Text string|@{"fqdn":string(name), "value":string("arbitrary text string"), "type":string(TXT)}@|supports multiple records| |/dns/zone/SPF|GET/PUT/POST/DELETE|SPF |/dns/zone/SPF|GET/POST/DELETE|SPF - Sender Policy Framework records|@{"fqdn":string(name), "value":string("v=spf1 a:mail.example.com -all"), "type":string(SPF)}@|supports multiple records| |/dns/zone/MX|GET/PUT/POST/DELETE|MX |/dns/zone/MX|GET/POST/DELETE|MX - Mail Exchanger records|@{"fqdn":string(name), "value":integer(preference), "value":string(ip/name), "type":string(MX)}@|Needs an extra preference number field, supports multiple records| h3. Deferred: /dns/zone/SOA (Can not be dynamically deleted, and needs extra code to handle) /dns/zone/NS (Needs manual serial number increment /dns/zone/SRV (Needs more research.. Looks easy enough http://en.wikipedia.org/wiki/SRV_record, but isn't a priority yet) /dns/zone/ZONE (Currently smartproxy uses nsupdate to make changes so zone creation and deletion is not supported on the backend.) h2. Methods GET - Lists resource records or gets the details of an individual record(s) PUT - Replaces a record or collection POST - Creates a new record or records DELETE - Deletes a record or records h2. Ohad notes GET /dns/zone/record_type list of all dns records with a given type, for example all CNAME would be /dns/1.2.3.4/CNAME GET /dns/zone/record -> details of the specific record. POST /dns/zone -> creates a new record DELETE /dns/zone/record -> deletes a record h2. Brian notes Dynamic DNS RFC http://tools.ietf.org/html/rfc2136 Howto: http://caunter.ca/nsupdate.txt SOA: https://lists.isc.org/pipermail/bind-users/2003-November/047015.html MX: http://forums.devshed.com/dns-36/using-nsupdate-to-add-an-mx-record-326788.html NS: http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1304925290721+28353475&threadId=702920 h2. Other APIs to investigate http://dyn.com/developer http://docs.amazonwebservices.com/Route53/latest/APIReference/ http://ns.zerigo.com/ h2. DNS backends NSUPDATE/BIND Amazon/Route53 Dynect/DynDNS DNSMadeEasy UltraDNS ActiveDirectory/Microsoft DNS h3. Additional features An API to retrieve the proxy's settings might be useful for consistency checks and diagnostic reasons. Should foreman also be provided with the ability to push settings out into the proxies, though this might prove to be a security issue?