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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
博客园 - Franky
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
T
Threatpost
Last Week in AI
Last Week in AI
P
Privacy International News Feed
S
SegmentFault 最新的问题
aimingoo的专栏
aimingoo的专栏
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
Cisco Talos Blog
Cisco Talos Blog
T
Tailwind CSS Blog
Blog — PlanetScale
Blog — PlanetScale
G
GRAHAM CLULEY
GbyAI
GbyAI
G
Google Developers Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
B
Blog RSS Feed
A
About on SuperTechFans
H
Help Net Security
T
Threat Research - Cisco Blogs
C
Check Point Blog
S
Schneier on Security
Google DeepMind News
Google DeepMind News
T
The Exploit Database - CXSecurity.com
博客园 - 叶小钗
Scott Helme
Scott Helme
博客园 - 司徒正美
美团技术团队
W
WeLiveSecurity
O
OpenAI News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
AWS News Blog
AWS News Blog
I
InfoQ

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 Compile Time Enabling or Disabling Plugins When Should Plugins be External? Add External Plugins 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
Corefile Explained
miek · 2017-07-24 · via Blogs on CoreDNS: DNS and Service Discovery

The Corefile is CoreDNS’s configuration file. It defines:

  • What servers listen on what ports and which protocol.
  • For which zone each server is authoritative.
  • Which plugins are loaded in a server.

To explain more, let take a look at this “Corefile”:

ZONE:[PORT] {
    [PLUGIN]...
}
  • ZONE defines the zone this server. The optional PORT defaults to 53, or the value of the -dns.port flag.
  • PLUGIN defines the plugin(s) we want to load. This is optional as well, but a server with no plugins will just return SERVFAIL for all queries. Each plugin can have a number of properties than can have arguments

I.e., in the next example:

The ZONE is root zone ., the PLUGIN is chaos. The chaos plugin does not have any properties, but it does take an argument: CoreDNS-001. This text is returned on a CH class query: dig CH txt version.bind @localhost

. {
   chaos CoreDNS-001
}

If CoreDNS can’t find a Corefile to load is loads the following builtin one that loads the whoami plugin:

. {
    whoami
}

Servers

This is the most minimal Corefile:

. { }

That defines a server to listen on port 53 and make it authoritative for the root zone and everything below. Let’s define another server that is authoritative for . (root zone) and load that:

This will make CoreDNS exit with an error:

2017/07/23 20:39:10 cannot serve dns://.:53 - zone already defined for dns://.:53

Why? Because we already defined a server on the same port for this zone. If we change the port number on the second server and thereby creating another server, it is OK:

When defining a new zone, you either create a new server, or add it to an existing one. Here we define one server that handles two zones; that potentially chain different plugin:

example.org {
    whoami
}
org {
    whoami
}

Note that most specific zone wins when a query comes in, so any example.org queries are going through the server defined for example.org above. The queries for .org are going to the other server.

Reverse Zones

Normally when you want to serve a reverse zone you’ll have to say something:

0.0.10.in-addr.arpa {
    whoami
}

To make this easier CoreDNS just allows you to say:

10.0.0.0/24 {
    whoami
}

This also works for CIDR (in the 1.0.0 release) zones:

10.0.0.0/27 {
    whoami
}

Non Default Protocols

Listening on TLS and for gRPC? Use:

tls://example.org grpc://example.org {
    # ...
}

Specifying ports works in the same way, here when listening for gRPC packets.

grpc://example.org:1443 {
    # ...
}

Also See

The Corefile is parsed like a Caddyfile. We support everything that is described on that page, for instance the use of environment variables.

Other interesting plugins that are helpful in Corefiles are: import startup and shutdown.