惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Spread Privacy
Spread Privacy
D
Docker
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
F
Full Disclosure
美团技术团队
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
Security Latest
Security Latest
C
Check Point Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
罗磊的独立博客
A
Arctic Wolf
S
Schneier on Security
T
Threatpost
C
CERT Recently Published Vulnerability Notes
L
LangChain Blog
博客园 - 叶小钗
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 聂微东
T
The Exploit Database - CXSecurity.com
W
WeLiveSecurity
Engineering at Meta
Engineering at Meta
C
Cybersecurity and Infrastructure Security Agency CISA
GbyAI
GbyAI
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Heimdal Security Blog
L
LINUX DO - 热门话题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
O
OpenAI News
G
GRAHAM CLULEY
M
MIT News - Artificial intelligence
S
Security @ Cisco Blogs
博客园 - 司徒正美
N
News and Events Feed by Topic
Microsoft Azure Blog
Microsoft Azure Blog
Cisco Talos Blog
Cisco Talos Blog
P
Palo Alto Networks Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Schneier on Security
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
月光博客
月光博客
The Last Watchdog
The Last Watchdog
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Security Blog
Microsoft Security Blog
C
Cisco Blogs
雷峰网
雷峰网

Blogs on CoreDNS: DNS and Service Discovery

CoreDNS-1.14.2 Release CoreDNS-1.14.1 Release CoreDNS-1.14.0 Release CoreDNS-1.13.2 Release CoreDNS-1.13.1 Release CoreDNS-1.13.0 Release CoreDNS-1.12.4 Release CoreDNS-1.12.3 Release CoreDNS-1.12.2 Release CoreDNS-1.12.1 Release CoreDNS-1.12.0 Release CoreDNS-1.11.4 Release CoreDNS-1.11.3 Release CoreDNS-1.11.2 Release CoreDNS-1.11.1 Release CoreDNS-1.11.0 Release CoreDNS-1.10.1 Release CoreDNS-1.10.0 Release CoreDNS-1.9.4 Release CoreDNS-1.9.3 Release CoreDNS-1.9.2 Release CoreDNS-1.9.1 Release CoreDNS and Apache APISIX open new doors for Service Discovery? Trail Of Bits Security Review CoreDNS-1.9.0 Release CoreDNS-1.8.7 Release CoreDNS-1.8.6 Release CoreDNS-1.8.5 Release CoreDNS-1.8.4 Release CoreDNS-1.8.3 Release CoreDNS-1.8.2 Release CoreDNS-1.8.1 Release CoreDNS-1.8.0 Release CoreDNS-1.7.1 Release CoreDNS-1.7.0 Release CoreDNS-1.6.8 Release CoreDNS-1.6.9 Release CoreDNS-1.6.7 Release CoreDNS-1.6.6 Release CoreDNS-1.6.5 Release CoreDNS-1.6.4 Release CoreDNS-1.6.3 Release CoreDNS-1.6.2 Release CoreDNS-1.6.1 Release CoreDNS-1.6.0 Release CoreDNS-1.5.2 Release CoreDNS-1.5.1 Release CoreDNS-1.5.0 Release CoreDNS-1.4.0 Release CoreDNS-1.3.1 Release CoreDNS-1.3.0 Release Cluster DNS: CoreDNS vs Kube-DNS Scaling CoreDNS in Kubernetes Clusters CoreDNS-1.2.6 Release CoreDNS-1.2.5 Release CoreDNS-1.2.4 Release CoreDNS-1.2.3 Release CoreDNS-1.2.2 Release CoreDNS-1.2.1 Release CoreDNS-1.2.0 Release CoreDNS-1.1.4 Release CoreDNS-1.1.3 Release Migration from kube-dns to CoreDNS CoreDNS-1.1.2 Release CoreDNS-1.1.1 Release Cure53 Security Assessment CoreDNS-1.1.0 Release CoreDNS-1.0.6 Release Deploying Kubernetes with CoreDNS using kubeadm CoreDNS-1.0.5 Release CoreDNS-1.0.4 Release CoreDNS-1.0.3 Release CoreDNS-1.0.2 Release CoreDNS-1.0.1 Release CoreDNS-1.0.0 Release CoreDNS-0.9.10 Release Setting up CoreDNS (on AWS) CoreDNS-0.9.9 Release Semantic Versioning CoreDNS-011 Release A first look at CoreDNS CoreDNS Performance Testing Logging with dnstap Intro to CoreDNS webinar by John Belamaric CoreDNS-010 Release When Should Plugins be External? Add External Plugins Corefile Explained CoreDNS-009 Release CoreDNS-008 Release How Queries Are Processed in CoreDNS Custom DNS Entries For Kubernetes CoreDNS-007 Release CoreDNS for Minikube Why CNCF for CoreDNS? CoreDNS for Kubernetes Service Discovery, Take 2 How to Add Plugins to CoreDNS History of CoreDNS in four posts. CoreDNS-006 Release CoreDNS-005 Release
Compile Time Enabling or Disabling Plugins
miek · 2017-07-25 · via Blogs on CoreDNS: DNS and Service Discovery

CoreDNS’ plugins (or external plugins) can be enabled or disabled on the fly by specifying (or not specifying) it in the Corefile. But you can also compile CoreDNS with only the plugins you need and leave the rest completely out.

There are two ways to achieve that. It could be done via compile-time configuration file with CoreDNS code base update. It also could be achieved without modifying CoreDNS code.

Build with compile-time configuration file

The with compile-time configuration file, plugin.cfg is all you need to update. It looks like this:

...
whoami:whoami
erratic:erratic
example:github.com/coredns/example
...

The ordering of the plugins is specified by how they are ordered in this file. Each line consists of a name and a repository. Just add or remove your plugin in this file.

Then do a go get <plugin-repo-path> if you need to get the external plugin’s source code. And then just compile CoreDNS with go generate and a go build. You can then check if CoreDNS has the new plugin with coredns -plugins.

Build with external golang source code

Alternatively, you could assemble plugins from different places through an external golang program. It looks like this:

package main

import (
        _ "github.com/coredns/example"

        "github.com/coredns/coredns/coremain"
        "github.com/coredns/coredns/core/dnsserver"
)

var directives = []string{
        "example",
        ...
        ...
        "whoami",
        "startup",
        "shutdown",
}

func init() {
        dnsserver.Directives = directives
}

func main() {
        coremain.Run()
}

In the above sample code, the external plugin example has been imported with:

        _ "github.com/coredns/example"

The directives should also be updated through:

        dnsserver.Directives = directives

The ordering of the plugins is specified by how the arey ordered in the slice directives.

Then you can just compile CoreDNS with go build to have the binary generated with the plugins you selected.