Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: [SOLVED] Bind9 won't start

  1. #1
    Join Date
    Sep 2007
    Beans
    286

    [SOLVED] Bind9 won't start

    I'm setting up a server using the ubuntu 8.04 perfect server guide, and I got to the section where you start bind9 after stopping it. I'm getting errors in my syslog. Here's the section with the errors. I believe it is something to do with permissions, but not sure why. Any help would be greatly appreciated.

    May 19 20:36:36 atlas named[6398]: starting BIND 9.4.2 -u bind -t /var/lib/named
    May 19 20:36:36 atlas named[6398]: found 1 CPU, using 1 worker thread
    May 19 20:36:36 atlas named[6398]: loading configuration from '/etc/bind/named.conf'
    May 19 20:36:36 atlas named[6398]: none:0: open: /etc/bind/named.conf: permission denied
    May 19 20:36:36 atlas named[6398]: loading configuration: permission denied
    May 19 20:36:36 atlas named[6398]: exiting (due to fatal error)
    May 19 20:36:36 atlas kernel: [38722.446742] audit(1211247396.427:2): type=1503 operation="inode_permission" requested_mask="r::" denied_mask="r::" name="/var/lib/named/etc/bind/named.conf" pid=6399 profile="/usr/sbin/named" namespace="default"

  2. #2
    Join Date
    May 2005
    Location
    Lyon, France
    Beans
    917
    Distro
    Ubuntu Development Release

    Re: Bind9 won't start

    silly question but have you checked /etc/bind/named.conf ownership and permissions?

  3. #3
    Join Date
    Sep 2007
    Beans
    286

    Re: Bind9 won't start

    I have, it seems that everyone should be able to read the file, does it need to have write/execute privileges as well? Here's the ls -la for that:

    -rw-r--r-- 1 bind bind 907 2008-04-09 14:42 /etc/bind/named.conf

    I'm afraid this is the first time bind9 has actually given me a problem.

  4. #4
    Join Date
    May 2005
    Location
    Lyon, France
    Beans
    917
    Distro
    Ubuntu Development Release

    Re: Bind9 won't start

    mine is
    -rw-r--r-- 1 root bind /etc/bind/named.conf

    user not being root is not your problem though. Sorry I am at a loss here.

  5. #5
    Join Date
    Sep 2007
    Beans
    286

    Re: Bind9 won't start

    Perhaps I should clear it off the machine and reinstall it from there?

  6. #6
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Bind9 won't start

    It is worth a shot. But, try changing ownership first and check the rest of the files in there also. If you need to change ownership, use:
    Code:
    sudo chown root:bind /etc/bind/named.conf
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  7. #7
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,868
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Bind9 won't start

    I am in the middle of following the perfect setup myself. It has the user modify some things.

    Edit the file /etc/default/bind9 so that the daemon will run as the unprivileged user bind, chrooted to /var/lib/named. Modify the line: OPTIONS="-u bind" so that it reads OPTIONS="-u bind -t /var/lib/named":



    Create the necessary directories under /var/lib:

    Code:
    mkdir -p /var/lib/named/etc
    mkdir /var/lib/named/dev
    mkdir -p /var/lib/named/var/cache/bind
    mkdir -p /var/lib/named/var/run/bind/run
    Then move the config directory from /etc to /var/lib/named/etc:

    Code:
    mv /etc/bind /var/lib/named/etc
    Create a symlink to the new config directory from the old location (to avoid problems when bind gets updated in the future):

    Code:
    ln -s /var/lib/named/etc/bind /etc/bind
    Make null and random devices, and fix permissions of the directories:
    Code:
    mknod /var/lib/named/dev/null c 1 3
    mknod /var/lib/named/dev/random c 1 8
    chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
    chown -R bind:bind /var/lib/named/var/*
    chown -R bind:bind /var/lib/named/etc/bind
    Here is the error I get.

    Code:
    /etc/init.d/bind9 restart
     * Stopping domain name service... bind                                         rndc: connect failed: 127.0.0.1#953: connection refused
    /var/log/syslog
    Code:
    found 1 CPU, using 1 worker thread
    May 21 18:38:25 Gail named[5359]: loading configuration from '/etc/bind/named.conf'
    May 21 18:38:25 Gail named[5359]: none:0: open: /etc/bind/named.conf: permission denied
    May 21 18:38:25 Gail named[5359]: loading configuration: permission denied
    May 21 18:38:25 Gail named[5359]: exiting (due to fatal error)
    May 21 18:38:25 Gail kernel: [ 2999.652630] audit(1211409505.327:2): type=1503 operation="inode_permission" requested_mask="r::" denied_mask="r::" name="/var/lib/named/etc/bind/named.conf" pid=5512 profile="/usr/sbin/named" namespace="default"
    May 21 18:41:09 Gail named[5415]: starting BIND 9.4.2 -u bind -t /var/lib/named

    Here are some of my permissions

    Code:
    ls -alt /etc/bind/named.conf
    -rw-r--r-- 1 bind bind 907 2008-04-09 15:42 /etc/bind/named.conf
    ls -alt /var/lib/named/etc/bind/named.conf
    -rw-r--r-- 1 bind bind 907 2008-04-09 15:42 /var/lib/named/etc/bind/named.conf
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  8. #8
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,868
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Bind9 won't start

    It is working now. I am not sure if it was fixed simply by restarting the pc. I did make one change to the system. I am not sure how this would affect it. I had an error during earlier config. I have two sites I am working on. One is a test site, the other is currently hosted outside my lan.

    I used in in my /etc/host the test site. When I ran

    Code:
    echo server1.example.com > /etc/hostname
    I incorrectly inserted the wrong host name (my other site, hosted outside my lan).

    So now I continue the install/config.
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  9. #9
    Join Date
    Sep 2007
    Beans
    286

    Re: Bind9 won't start

    Sounds like a restart would be worth a shot. I'm rebooting it now. Unfortunatly, I'm not near it so hopefully it will go well... (crosses fingers). My permissions are almost identical to yours. I'm not going to change it to root, as I think that would probably break it even more. It is fully setup to be run as bind.

  10. #10
    Join Date
    Sep 2007
    Beans
    286

    Re: [SOLVED] Bind9 won't start

    Restart fixed the problem just fine! Thanks for the advice.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •