update doc to not use the root zone for everything (#3288)

Update all documentation in the tree to use example.org as an example
configuration (in so far possible). As to get out of the just use "."
and fallthrough and things would be fine.

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2019-09-19 14:17:53 +01:00
committed by Yong Tang
parent 31299108ce
commit 62317c3c14
14 changed files with 62 additions and 45 deletions

View File

@@ -82,8 +82,11 @@ When starting CoreDNS without any configuration, it loads the
~~~ txt ~~~ txt
.:53 .:53
2016/09/18 09:20:50 [INFO] CoreDNS-001 ______ ____ _ _______
CoreDNS-001 / ____/___ ________ / __ \/ | / / ___/ ~ CoreDNS-1.6.3
/ / / __ \/ ___/ _ \/ / / / |/ /\__ \ ~ linux/amd64, go1.13,
/ /___/ /_/ / / / __/ /_/ / /| /___/ /
\____/\____/_/ \___/_____/_/ |_//____/
~~~ ~~~
Any query sent to port 53 should return some information; your sending address, port and protocol Any query sent to port 53 should return some information; your sending address, port and protocol
@@ -128,17 +131,20 @@ Serve `example.org` on port 1053, but forward everything that does *not* match `
recursive nameserver *and* rewrite ANY queries to HINFO. recursive nameserver *and* rewrite ANY queries to HINFO.
~~~ txt ~~~ txt
.:1053 { example.org:1053 {
rewrite ANY HINFO file /var/lib/coredns/example.org.signed {
forward . 8.8.8.8:53
file /var/lib/coredns/example.org.signed example.org {
transfer to * transfer to *
transfer to 2001:500:8f::53 transfer to 2001:500:8f::53
} }
errors errors
log log
} }
. {
any
forward . 8.8.8.8:53
errors
log
}
~~~ ~~~
IP addresses are also allowed. They are automatically converted to reverse zones: IP addresses are also allowed. They are automatically converted to reverse zones:

View File

@@ -56,8 +56,8 @@ Load `org` domains from `/etc/coredns/zones/org` and allow transfers to the inte
notifies to 10.240.1.1 notifies to 10.240.1.1
~~~ corefile ~~~ corefile
. { org {
auto org { auto {
directory /etc/coredns/zones/org directory /etc/coredns/zones/org
transfer to * transfer to *
transfer to 10.240.1.1 transfer to 10.240.1.1

View File

@@ -93,13 +93,13 @@ Proxy to Google Public DNS and only cache responses for example.org (or below).
} }
~~~ ~~~
Enable caching for all zones, keep a positive cache size of 5000 and a negative cache size of 2500: Enable caching for `example.org`, keep a positive cache size of 5000 and a negative cache size of 2500:
~~~ corefile ~~~ corefile
. { example.org {
cache { cache {
success 5000 success 5000
denial 2500 denial 2500
} }
} }
~~~ ~~~

View File

@@ -25,7 +25,7 @@ cancel [TIMEOUT]
## Examples ## Examples
~~~ corefile ~~~ corefile
. { example.org {
cancel cancel
whoami whoami
} }
@@ -34,7 +34,7 @@ cancel [TIMEOUT]
Or with a custom timeout: Or with a custom timeout:
~~~ corefile ~~~ corefile
. { example.org {
cancel 1s cancel 1s
whoami whoami
} }

View File

@@ -49,7 +49,7 @@ clouddns [ZONE:PROJECT_ID:HOSTED_ZONE_NAME...] {
Enable clouddns with implicit GCP credentials and resolve CNAMEs via 10.0.0.1: Enable clouddns with implicit GCP credentials and resolve CNAMEs via 10.0.0.1:
~~~ txt ~~~ txt
. { example.org {
clouddns example.org.:gcp-example-project:example-zone clouddns example.org.:gcp-example-project:example-zone
forward . 10.0.0.1 forward . 10.0.0.1
} }
@@ -58,7 +58,7 @@ Enable clouddns with implicit GCP credentials and resolve CNAMEs via 10.0.0.1:
Enable clouddns with fallthrough: Enable clouddns with fallthrough:
~~~ txt ~~~ txt
. { example.org {
clouddns example.org.:gcp-example-project:example-zone clouddns example.com.:gcp-example-project:example-zone-2 { clouddns example.org.:gcp-example-project:example-zone clouddns example.com.:gcp-example-project:example-zone-2 {
fallthrough example.gov. fallthrough example.gov.
} }

View File

@@ -45,4 +45,4 @@ Disable the ability to recover from crashes and show debug logging:
## Also See ## Also See
https://www.wireshark.org/docs/man-pages/text2pcap.html. <https://www.wireshark.org/docs/man-pages/text2pcap.html>.

View File

@@ -40,7 +40,7 @@ This plugin reports readiness to the ready plugin.
## Examples ## Examples
~~~ corefile ~~~ corefile
. { example.org {
erratic { erratic {
drop 3 drop 3
} }
@@ -50,7 +50,7 @@ This plugin reports readiness to the ready plugin.
Or even shorter if the defaults suits you. Note this only drops queries, it does not delay them. Or even shorter if the defaults suits you. Note this only drops queries, it does not delay them.
~~~ corefile ~~~ corefile
. { example.org {
erratic erratic
} }
~~~ ~~~
@@ -58,7 +58,7 @@ Or even shorter if the defaults suits you. Note this only drops queries, it does
Delay 1 in 3 queries for 50ms Delay 1 in 3 queries for 50ms
~~~ corefile ~~~ corefile
. { example.org {
erratic { erratic {
delay 3 50ms delay 3 50ms
} }
@@ -68,7 +68,7 @@ Delay 1 in 3 queries for 50ms
Delay 1 in 3 and truncate 1 in 5. Delay 1 in 3 and truncate 1 in 5.
~~~ corefile ~~~ corefile
. { example.org {
erratic { erratic {
delay 3 5ms delay 3 5ms
truncate 5 truncate 5
@@ -79,7 +79,7 @@ Delay 1 in 3 and truncate 1 in 5.
Drop every second query. Drop every second query.
~~~ corefile ~~~ corefile
. { example.org {
erratic { erratic {
drop 2 drop 2
truncate 2 truncate 2
@@ -89,5 +89,4 @@ Drop every second query.
## Also See ## Also See
[RFC 3849](https://tools.ietf.org/html/rfc3849) and [RFC 3849](https://tools.ietf.org/html/rfc3849) and [RFC 5737](https://tools.ietf.org/html/rfc5737).
[RFC 5737](https://tools.ietf.org/html/rfc5737).

View File

@@ -38,10 +38,10 @@ For better performance, it's recommended to use the `^` or `$` metacharacters in
## Examples ## Examples
Use the *whoami* to respond to queries and Log errors to standard output. Use the *whoami* to respond to queries in the example.org domain and Log errors to standard output.
~~~ corefile ~~~ corefile
. { example.org {
whoami whoami
errors errors
} }

View File

@@ -77,15 +77,19 @@ This causes two lookups from CoreDNS to etcdv3 in certain cases.
This is the default SkyDNS setup, with everything specified in full: This is the default SkyDNS setup, with everything specified in full:
~~~ corefile ~~~ corefile
. { skydns.local {
etcd skydns.local { etcd {
path /skydns path /skydns
endpoint http://localhost:2379 endpoint http://localhost:2379
} }
prometheus prometheus
cache 160 skydns.local cache
loadbalance loadbalance
}
. {
forward . 8.8.8.8:53 8.8.4.4:53 forward . 8.8.8.8:53 8.8.4.4:53
cache
} }
~~~ ~~~
@@ -93,12 +97,16 @@ Or a setup where we use `/etc/resolv.conf` as the basis for the proxy and the up
when resolving external pointing CNAMEs. when resolving external pointing CNAMEs.
~~~ corefile ~~~ corefile
. { skydns.local {
etcd skydns.local { etcd {
path /skydns path /skydns
} }
cache 160 skydns.local cache
}
. {
forward . /etc/resolv.conf forward . /etc/resolv.conf
cache
} }
~~~ ~~~

View File

@@ -104,11 +104,12 @@ next plugin if query doesn't match.
Load hosts file inlined in Corefile. Load hosts file inlined in Corefile.
~~~ ~~~
. { example.hosts example.org {
hosts example.hosts example.org { hosts {
10.0.0.1 example.org 10.0.0.1 example.org
fallthrough fallthrough
} }
whoami
} }
~~~ ~~~

View File

@@ -92,7 +92,7 @@ The default Common Log Format is:
Each of these logs will be outputted with `log.Infof`, so a typical example looks like this: Each of these logs will be outputted with `log.Infof`, so a typical example looks like this:
~~~ txt ~~~ txt
2018-10-30T19:10:07.547Z [INFO] [::1]:50759 - 29008 "A IN example.org. udp 41 false 4096" NOERROR qr,rd,ra,ad 68 0.037990251s [INFO] [::1]:50759 - 29008 "A IN example.org. udp 41 false 4096" NOERROR qr,rd,ra,ad 68 0.037990251s
~~~~ ~~~~
## Examples ## Examples

View File

@@ -28,7 +28,7 @@ If **DATA** is not given, the host's name is used.
Enable nsid: Enable nsid:
~~~ corefile ~~~ corefile
. { example.org {
whoami whoami
nsid Use The Force nsid Use The Force
} }

View File

@@ -62,8 +62,11 @@ route53 [ZONE:HOSTED_ZONE_ID...] {
Enable route53 with implicit AWS credentials and resolve CNAMEs via 10.0.0.1: Enable route53 with implicit AWS credentials and resolve CNAMEs via 10.0.0.1:
~~~ txt ~~~ txt
. { example.org {
route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7 route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7
}
. {
forward . 10.0.0.1 forward . 10.0.0.1
} }
~~~ ~~~
@@ -71,7 +74,7 @@ Enable route53 with implicit AWS credentials and resolve CNAMEs via 10.0.0.1:
Enable route53 with explicit AWS credentials: Enable route53 with explicit AWS credentials:
~~~ txt ~~~ txt
. { example.org {
route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7 { route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7 {
aws_access_key AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY aws_access_key AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
} }
@@ -91,14 +94,14 @@ Enable route53 with fallthrough:
Enable route53 with multiple hosted zones with the same domain: Enable route53 with multiple hosted zones with the same domain:
~~~ txt ~~~ txt
. { example.org {
route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7 example.org.:Z93A52145678156 route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7 example.org.:Z93A52145678156
} }
~~~ ~~~
Enable route53 and refresh records every 3 minutes Enable route53 and refresh records every 3 minutes
~~~ txt ~~~ txt
. { example.org {
route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7 { route53 example.org.:Z1Z2Z3Z4DZ5Z6Z7 {
refresh 3m refresh 3m
} }

View File

@@ -34,7 +34,7 @@ whoami
Start a server on the default port and load the *whoami* plugin. Start a server on the default port and load the *whoami* plugin.
~~~ corefile ~~~ corefile
. { example.org {
whoami whoami
} }
~~~ ~~~