【问题标题】:Adding hosts to coredns将主机添加到 coredns
【发布时间】:2020-12-16 15:57:21
【问题描述】:

我有一个运行 coredns 的 kubernetes 安装,我想覆盖某些域(或更好的子域)以解析为内部 IP。

所以读到这个:https://coredns.io/plugins/hosts/,我更新了我的配置(Corefile)看起来像这样:

.:53 {
    errors
    health {
       lameduck 5s
    }
    ready
    hosts {
        subdomain.my-domain.com 88.77.55.44
        fallthrough
    }
    kubernetes cluster.local in-addr.arpa ip6.arpa {
       pods insecure
       fallthrough in-addr.arpa ip6.arpa
       ttl 30
    }
    prometheus :9153
    forward . /etc/resolv.conf {
       max_concurrent 1000
    }
    cache 30
    loop
    reload
    loadbalance
}

但是当我这样做时:

dig subdomain.my-domain.com

我获得了该域的外部 IP,而不是 88.77.66.55

出了点问题,但我不清楚是什么……

【问题讨论】:

    标签: coredns


    【解决方案1】:

    您需要像这样使用 IP subdomain.domain.com:

    ...
        hosts {
            88.77.55.44 subdomain.my-domain.com
            fallthrough
        }
    ...
    

    https://coredns.io/plugins/hosts/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-01
      • 2018-07-24
      • 1970-01-01
      • 2013-07-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多