From e8631f990faf86f1f16e11f26f1b5d9db18f8df1 Mon Sep 17 00:00:00 2001 From: wecould Date: Sun, 26 Oct 2014 14:16:06 +0000 Subject: [PATCH] Update README.md Make it clear how to add records for quicker implementation --- pdns/docs/httpapi/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdns/docs/httpapi/README.md b/pdns/docs/httpapi/README.md index 13e2f0733..3694087dd 100644 --- a/pdns/docs/httpapi/README.md +++ b/pdns/docs/httpapi/README.md @@ -31,10 +31,15 @@ After restarting `pdns_server`, the following examples should start working: # List zones curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones | jq . + # Create new zone "example.org" with nameservers ns1.example.org, ns2.example.org curl -X POST --data '{"name":"example.org", "kind": "Native", "masters": [], "nameservers": ["ns1.example.org", "ns2.example.org"]}' -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones | jq . + # Show the new zone curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones/example.org | jq . + + # Add a new record to the new zone + curl -X PATCH --data '{"rrsets": [ {"name": "test.example.org", "type": "A", "changetype": "REPLACE", "records": [ {"content": "1.1.1.1", "disabled": false,"name": "test.example.org", "ttl": 86400, "type": "A" } ] } ] }' -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones/example.org | jq . `jq` is a highly recommended tool for pretty-printing JSON. If you don't have `jq`, try `json_pp` or `python -mjson.tool` instead. -- 2.50.0