自定义DNS解析

在corefile 中添加域名信息

 

apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health {
            lameduck 5s
        }
        ready
        hosts {
          192.78.95.36 ttttt.com.cn
          fallthrough
        }
        kubernetes cluster2.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
    }
kind: ConfigMap

 

fallthrough表示在hosts找不到解析的域名时,传递给CoreDNS的下一个插件,避免集群内部域名解析失败。

 

posted on 2024-04-19 09:45  属于我的梦,明明还在  阅读(2)  评论(0编辑  收藏  举报