diff options
author | 2022-08-03 06:51:49 -0400 | |
---|---|---|
committer | 2022-08-03 13:51:49 +0300 | |
commit | 0188090ae93557d02b7db25b13c83c86b412f172 (patch) | |
tree | 3adc96987901ba801ac67fa3c45ace4ca68d8eee | |
parent | cdf17bcaf1488a026301881f3bd124aca376144a (diff) | |
download | coredns-0188090ae93557d02b7db25b13c83c86b412f172.tar.gz coredns-0188090ae93557d02b7db25b13c83c86b412f172.tar.zst coredns-0188090ae93557d02b7db25b13c83c86b412f172.zip |
add CNAME example to README (#5537)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
-rw-r--r-- | plugin/template/README.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plugin/template/README.md b/plugin/template/README.md index cd63c94a2..ec37c7d26 100644 --- a/plugin/template/README.md +++ b/plugin/template/README.md @@ -242,6 +242,22 @@ Named capture groups can be used to template one response for multiple patterns. } ~~~ +### Fabricate a CNAME + +This example responds with a CNAME to `google.com` for any DNS query made exactly for `foogle.com`. +The answer will also contain a record for `google.com` if the upstream nameserver can return a record for it of the +requested type. + +~~~ corefile +. { + template IN ANY foogle.com { + match "^foogle\.com\.$" + answer "foogle.com 60 IN CNAME google.com" + } + forward . 8.8.8.8 +} +~~~ + ## Also see * [Go regexp](https://golang.org/pkg/regexp/) for details about the regex implementation |