首页 > 解决方案 > 为 coredns 设置区域文件

问题描述

我创建了一个名为 db.example.home 的区域文件

$ORIGIN example.home.
@   3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
                2017042746 ; serial
                7200       ; refresh (2 hours)
                3600       ; retry (1 hour)
                1209600    ; expire (2 weeks)
                3600       ; minimum (1 hour)
                )

    3600 IN NS a.iana-servers.net.
    3600 IN NS b.iana-servers.net.

www     IN A     127.0.0.1
        IN AAAA  ::1

在我看到的日志中

2020-08-22T15:16:02.961383295Z [INFO] plugin/reload: Running configuration MD5 = fe10aca860b9e9cf7988937438619317
,2020-08-22T15:23:02.960503545Z [ERROR] plugin/file: Failed to open zone "example.home." in "db.example.home": open db.example.home: no such file or directory

即使我的 db.example.home 与配置文件位于同一位置。

我的 coredns 配置文件如下所示:

.:53 {
  forward . tls://192.168.5.238 tls://1.1.1.1 {
    tls_servername cloudflare-dns.com
    health_check 10s
  }
  log
  errors
  cache
  prometheus :9153
        loop
        reload
        loadbalance
}

example.org {
    file db.example.org
    log
}

我希望有人可以通过一些了解这里出了什么问题..

标签: corednsbind9

解决方案


推荐阅读