# Plugins ## Writing Plugins See a couple of blog posts on how to write and add plugin to CoreDNS: * * , slightly older, but useful. ## Metrics When exporting metrics the *Namespace* should be `plugin.Namespace` (="coredns"), and the *Subsystem* should be the name of the plugin. The README.md for the plugin should then also contain a *Metrics* section detailing the metrics. If the plugin supports dynamic health reporting it should also have *Health* section detailing on some of its inner workings. ## Documentation Each plugin should have a README.md explaining what the plugin does and how it is configured. The file should have the following layout: * Title: use the plugin's name * Subsection titled: "Syntax" * Subsection titled: "Examples" More sections are of course possible. ### Style We use the Unix manual page style: * The name of plugin in the running text should be italic: *plugin*. * all CAPITAL: user supplied argument, in the running text references this use strong text: `**`: **EXAMPLE**. * Optional text: in block quotes: `[optional]`. * Use three dots to indicate multiple options are allowed: `arg...`. * Item used literal: `literal`. ### Example Domain Names Please be sure to use `example.org` or `example.net` in any examples you provide. These are the standard domain names created for this purpose. ## Fallthrough In a perfect world the following would be true for plugin: "Either you are responsible for a zone or not". If the answer is "not", the plugin should call the next plugin in the chain. If "yes" it should handle *all* names that fall in this zone and the names below - i.e. it should handle the entire domain. ~~~ txt . { file example.org db.example } ~~~ In this example the *file* plugin is handling all names below (and including) `example.org`. If a query comes in that is not a subdomain (or equal to) `example.org` the next plugin is called. Now, the world isn't perfect, and there are good reasons to "fallthrough" to the next middlware, meaning a plugin is only responsible for a subset of names within the zone. The first of these to appear was the *reverse* plugin that synthesis PTR and A/AAAA responses (useful with IPv6). The nature of the *reverse* plugin is such that it only deals with A,AAAA and PTR and then only for a subset of the names. Ideally you would want to layer *reverse* **in front off** another plugin such as *file* or *auto* (or even *proxy*). This means *reverse* handles some special reverse cases and **all other** request are handled by the backing plugin. This is exactly what "fallthrough" does. To keep things explicit we've opted that plugins implement such behavior should implement a `fallthrough` keyword. ## Qualifying for main repo Plugins for CoreDNS can live out-of-tree, `plugin.cfg` defaults to CoreDNS' repo but other repos work just as well. So when do we consider the inclusion of a new plugin in the main repo? * First, the plugin should be useful for other people. "Useful" is a subjective term. We will probably need to further refine this. * It should be sufficiently different from other plugin to warrant inclusion. * Current internet standards need be supported: IPv4 and IPv6, so A and AAAA records should be handled (if your plugin is in the business of dealing with address records that is). * It must have tests. * It must have a README.md for documentation. es/blog Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2022-04-26Revert "fix: replace serialize-javascript & random-bytes with custom internal...Gravatar Nate Moore 7-565/+215
2022-04-26[ci] formatGravatar okikio 2-271/+315
2022-04-26fix: replace serialize-javascript & random-bytes with custom internal modulesGravatar Okiki 7-215/+521
2022-04-26[ci] release (#3182)create-astro@0.10.0astro@1.0.0-beta.18@astrojs/vercel@0.1.4@astrojs/tailwind@0.2.1@astrojs/svelte@0.1.2@astrojs/netlify@0.3.3Gravatar github-actions[bot] 54-146/+130
2022-04-26[ci] formatGravatar matthewp 1-1/+1
2022-04-26fix(vercel): `trailingSlash` fix for non-html pages (#3185)Gravatar Juan Martín Seery 2-29/+42
2022-04-26Prevent watcher from running during the build (#3207)Gravatar Matthew Phillips 2-0/+9
2022-04-26Fix lockfile (#3210)Gravatar Juan Martín Seery 1-6/+0
2022-04-26Add missing is:raw in AstroBuiltinAttributes (#3209)Gravatar Erika 2-0/+6
2022-04-26Feat: support `astro add` without npm installing (#3183)Gravatar Ben Holmes 6-30/+49
2022-04-26Add Astro attributes to svg elements (#3205)Gravatar Erika 2-1/+9
2022-04-26[ci] formatGravatar bholmesdev 2-9/+9
2022-04-26Feat: `create astro` add install step (#3190)Gravatar Ben Holmes 7-162/+299
2022-04-26[ci] collect statsGravatar FredKSchott 1-0/+1
2022-04-25fix(markdown): file.url fixes (#3198)Gravatar Juan Martín Seery 11-10/+149
2022-04-25[ci] collect statsGravatar FredKSchott 1-0/+1
2022-04-24add vite to licenseGravatar Fred K. Schott 2-24/+29
2022-04-24feat(markdown): Improved types (#3191)Gravatar Juan Martín Seery 3-6/+47
2022-04-24[ci] collect statsGravatar FredKSchott 1-0/+1
2022-04-23[ci] collect statsGravatar FredKSchott 1-0/+1