coredns / coredns

CoreDNS is a DNS server that chains plugins
https://coredns.io
Apache License 2.0
12.32k stars 2.13k forks source link

plug hosts not work #6891

Open lanss315425 opened 2 weeks ago

lanss315425 commented 2 weeks ago

hi! this is my ConfigMap file

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns
  namespace: kube-system
  labels:
      addonmanager.kubernetes.io/mode: EnsureExists
data:
  Corefile: |
    .:53 {
        errors {
        }
        health {
            lameduck 5s
        }
        ready

        hosts {
          192.168.18.169 www.test.cn
          192.168.18.169 www.test.cn.default.svc.cluster.local
          192.168.18.169 www.test.cn.svc.cluster.local
          192.168.18.169 www.test.cn.cluster.local 
        }   

        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          fallthrough in-addr.arpa ip6.arpa
          except mah.devkylin.jinhua.com.cn.  #Whether it exists or not
        }

        prometheus :9153
        forward . 223.5.5.5 {
          prefer_udp
          max_concurrent 1000
          except mah.devkylin.jinhua.com.cn. #Whether it exists or not
        }
        cache 30

        log
        loop
        reload
        loadbalance
    }

when hosts is ,it not work expect

        hosts {
          192.168.18.169 www.test.cn
        }   
chengzhycn commented 1 week ago

what is your expected situation?