The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Enable DNS logging Not Working

Discussion in 'General Discussion' started by blipper, Mar 19, 2016.

  1. blipper

    blipper Member

    Joined:
    Jan 27, 2010
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Hi, I've got a new dns-only name server running and I want to make sure it's processing dns queries. So to this, I normally do this to enable it:

    root [/var/log]# rndc querylog

    But I'm getting this message:
    WARNING: key file (/etc/rndc.key) exists, but using default configuration file (/etc/rndc.conf)

    And when I do tail -f /var/log/messages, I do not see it logging any dns queries. When I perform nslookup xyz.com localhost it returns results showing me that bind is working, but nothing logged.

    This is on Centos-release-7-2.1511.el7.centos.2.10.x86_64, whm 54 build 19

    Ideas?
     
    #1 blipper, Mar 19, 2016
    Last edited: Mar 19, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    34,305
    Likes Received:
    999
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Have you tried using "dig @localhost" or the "dig" command from another server to see if that populates entries in /var/log/messages? The error message you referenced is a warning and should not prevent the command from succeeding.

    Thank you.
     
  3. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    68
    Likes Received:
    17
    Trophy Points:
    8
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello, I'm getting exactly the same error.
    DNS works normally, I did not detect any problems.

    But I would like to remove this warning since it is making the munin-node.log file get very large.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    34,305
    Likes Received:
    999
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    First, run the following commands to backup the existing configuration in-case you need to restore it:

    Code:
    cp -a /etc/named.conf /etc/named.conf.backup
    cp -a /etc/rndc.key /etc/rndc.key.backup
    Then, as a workaround to the Bind issue you have reported, you could copy the existing key file with a new name (ensure to keep the new file in the /etc/ directory). EX:

    Code:
    cp -a /etc/rndc.key /etc/rndc123.key
    Next, replace the following line in the /etc/named.conf file:

    Code:
    include "/etc/rndc.key";
    With:

    Code:
    include "/etc/rndc123.key";
    Once you do this, you can remove /etc/rndc.key and restart the Named service:

    Code:
    rm /etc/rndc.key
    /scripts/restartsrv_named
    This should prevent the warning message from appearing.

    Thank you.
     
    Rodrigo Gomes likes this.
  5. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    68
    Likes Received:
    17
    Trophy Points:
    8
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    It worked perfectly, thank you Michael!
     
    cPanelMichael likes this.
Loading...

Share This Page