AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1223561
Accepted
Tomas.R
Tomas.R
Asked: 2020-04-03 09:45:32 +0800 CST2020-04-03 09:45:32 +0800 CST 2020-04-03 09:45:32 +0800 CST

Bind9 dns 服务器日志记录选项 (Ubuntu 18.04)

  • 772

我想为我的 DNS 服务器(bind9)创建一个单独的文件来写入日志。我在Ubuntu 社区页面上找到了一些有关如何操作的信息。

所以我将这些行添加到/etc/bind/named.conf.local:

logging {
    channel query.log {
        file "/var/log/query.log";
        // Set the severity to dynamic to see all the debug messages.
        severity dynamic;
    };
};

我继续创建一个日志文件,授予它所有权限并重新启动bind9服务,当检查状态时我看到一个错误:

cd /var/log
touch query.log
chmod 777 query.log
systemctl restart bind9
systemctl status bind9
● bind9.service - BIND Domain Name Server
   Loaded: loaded (/lib/systemd/system/bind9.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-04-02 17:37:24 UTC; 1s ago
     Docs: man:named(8)
  Process: 5723 ExecStop=/usr/sbin/rndc stop (code=exited, status=0/SUCCESS)
  Process: 4480 ExecReload=/usr/sbin/rndc reload (code=exited, status=0/SUCCESS)
  Process: 5851 ExecStart=/usr/sbin/named -f $OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 5851 (code=exited, status=1/FAILURE)

Apr 02 17:37:24 ballgame named[5851]: command channel listening on 127.0.0.1#953
Apr 02 17:37:24 ballgame named[5851]: configuring command channel from '/etc/bind/rndc.key'
Apr 02 17:37:24 ballgame named[5851]: isc_stdio_open '/var/log/query.log' failed: permission denied
Apr 02 17:37:24 ballgame named[5851]: command channel listening on ::1#953
Apr 02 17:37:24 ballgame named[5851]: isc_stdio_open '/var/log/query.log' failed: permission denied
Apr 02 17:37:24 ballgame named[5851]: configuring logging: permission denied
Apr 02 17:37:24 ballgame named[5851]: loading configuration: permission denied
Apr 02 17:37:24 ballgame named[5851]: exiting (due to fatal error)
Apr 02 17:37:24 ballgame systemd[1]: bind9.service: Main process exited, code=exited, status=1/FAILURE
Apr 02 17:37:24 ballgame systemd[1]: bind9.service: Failed with result 'exit-code'.

有人可以解释一下这里缺少什么吗?

log dns
  • 1 1 个回答
  • 5831 Views

1 个回答

  • Voted
  1. Best Answer
    Waddles
    2020-11-23T23:17:34+08:002020-11-23T23:17:34+08:00
    ~# grep log /etc/apparmor.d/usr.sbin.named
      # some people like to put logs in /var/log/named/ instead of having
      # syslog do the heavy lifting.
      /var/log/named/** rw,
      /var/log/named/ rw,
    

    日志应该在,/var/log/named/否则 Apparmor 将默默地拒绝访问。如果您真的想覆盖包维护者的选择,请在/etc/apparmor.d/local/usr.sbin.named

    • 2

相关问题

  • 当应用程序崩溃而没有输出错误时,是否有我可以检查的日志?

  • 更改DNS IP的正确方法是什么?

  • 如何清除 DNS 缓存?

  • 如何更改确定有效用户密码的规则?[关闭]

  • 我如何知道 Ubuntu 的安装日期?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve