1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

SImple example to readme

This commit is contained in:
Craig Peterson
2017-03-14 00:30:02 -07:00
parent c68fd3ac26
commit e4f3fa6c10

View File

@@ -19,6 +19,27 @@ to an intermediate representation (IR). Compiler back-ends use the
IR to update your DNS zones on services such as Route53, CloudFlare, IR to update your DNS zones on services such as Route53, CloudFlare,
and Gandi, or systems such as BIND and ActiveDirectory. and Gandi, or systems such as BIND and ActiveDirectory.
# An Example
`dnsconfig.js`:
```
// define our registrar and providers
var namecom = NewRegistrar("name.com", "NAMEDOTCOM");
var r53 = NewDnsProvider("r53", "ROUTE53")
D("example.com", namecom, DnsProvider(r53),
A("@", "1.2.3.4"),
CNAME("www","@"),
MX("@",5,"mail.myserver.com"),
A("test", "5.6.7.8")
)
```
Running `dnscontrol preview` will talk to the providers (here name.com as registrar and route 53 as the dns host), and determine what changes need to be made.
Running `dnscontrol push` will make those changes with the provider and my dns records will be correclty updated.
# Benefits # Benefits
* Editing zone files is error-prone. Clicking buttons on a web * Editing zone files is error-prone. Clicking buttons on a web
@@ -51,6 +72,6 @@ Writing new plugins is very easy.
# Installation # Installation
`go get github.com/StackExchange/DNSControl` `go get github.com/StackExchange/dnsontrol`
or get prebuilt binaries from our github page. or get prebuilt binaries from our github page.