【问题标题】:Corefile to return fix addressCorefile 返回修复地址
【发布时间】:2019-10-17 13:00:06
【问题描述】:

我希望始终为具有 CoreDNS 的域返回某个地址。我的期望是在Corefile 上有一些这样的部分:

domain.of.mine {
  address 192.168.122.122 #this of course doesn't work
} 

所以,我总是用该地址作为域中名称的答案。 我的问题是:使用 CoreDNS 实现这一目标的最简单方法是什么?

我浏览了the available plugins,听起来最接近我想要的那个是template plugin,但我觉得应该有一个更简单的方法。

【问题讨论】:

    标签: coredns core-file


    【解决方案1】:

    我想出的是使用template 插件:

    domain.of.mine {
      template ANY ANY {
        answer "{{ .Name }} 60 {{ .Class }} {{ .Type }} 192.168.122.122"
      }
    } 
    

    它将有效地响应具有指定地址的任何请求。

    【讨论】:

      猜你喜欢
      • 2012-09-19
      • 2017-04-04
      • 2020-10-09
      • 2016-03-16
      • 1970-01-01
      • 2016-01-10
      • 2010-12-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多