16 posts / 0 new
Last post
#1 Wed, 04/08/2009 - 11:29
AMVx86

BIND9 Errors

Eric,

I've installed virtual min with no problem. I'm trying to setup the DNS server and it's being quite obnoxious. It's complaining about: Download failed : Failed to open /var/run/bind/run/named.pid /var/run/named.pid for writing : Bad file descriptor I'm running ubuntu server 8.10 and, i have even chmodded those files to 777 to test if that was the issue, I have googled since 7 am till now (4:30) and the only help and support is for cent os with installing bind-chroot. I searched for a similar package on ubuntu in the apt-get repositories and i have found nothing.

Is there something I'm missing or is this a bug in the application framework?! Any help at this point will be appreciated.

Regards, Anthony.<br><br>Post edited by: AMVx86, at: 2009/04/09 06:27

Wed, 04/08/2009 - 11:51
andreychek

Hi Anthony,

When is it that you receive the error you mentioned above? What action are you doing when that error comes up?

Also, if you log in over SSH, what output do you get if you type from from the command line:

1. cat /etc/default/bind9

2. ps auxw | grep bind

Thanks,
-Eric

Wed, 04/08/2009 - 11:58
AMVx86

Andreychek,

The issue happened when i was setting up BIND9, I'm not proficient with setting up BIND and was willing and more than eager to let the system help set it up, as proposed in this document herein: http://doxfer.com/Webmin/BINDDNSServer with selecting the &quot;setup as an internet name server.&quot; So, i removed the /etc/init.d/named.conf file and when i try to create the files with the &quot;internet NS&quot; option, i get the error.

When i tried to start BIND i also get the error message; considering the config file is not present, granted such an action [fail] is normal. I have even created the folders the files are into be chmodded to 755, 777 and back to the regular rwx rw x values and it still complains.

I have even ripped out the webmin packages, and as i write this am re-installing the base system again! As per your request, here is the cat output of /etc/default/bind9

OPTIONS=&quot;-u bind -t /var/lib/named&quot;
# Set RESOLVCONF=no to not run resolvconf
RESOLVCONF=yes

Any suggestions? And, thank you for prompt reply.

Kindest Regards,
Anthony.

Wed, 04/08/2009 - 12:13 (Reply to #3)
andreychek

I'm racing out to grab some dinner now, but as a quick response before I head out -- Debian and Ubuntu (so far as I know!) don't do any chroot goodies, by default.

However, in the config listed above, it has the -t switch, causing BIND to chroot into /var/lib/named.

My guess is that things aren't setup to handle chrooting, and that's where it's breaking.

My recommendation is to change this line:

[code:1]OPTIONS=&quot;-u bind -t /var/lib/named&quot;[/code:1]

To this:

[code:1]OPTIONS=&quot;-u bind&quot;[/code:1]

And then restart BIND:

/etc/init.d/bind9 restart

And that will hopefully do the trick!
-Eric

Wed, 04/08/2009 - 12:29
AMVx86

Eric,

Thanks for the reply i will look into the suggestion to which you've made. Hopefully something can be done with this error. I do believe my defaults were to the second line you are suggesting changing to. In another tutorial they did suggest to change it to what i had. I will give it one more shot. If this fails (your suggestion from the default) is there anything that can be done?

Regards,
Anthony.

Wed, 04/08/2009 - 13:47 (Reply to #5)
andreychek

<div class='quote'>If this fails (your suggestion from the default) is there anything that can be done?</div>

There's always something that can be done :-)

But let's try getting BIND working as it normally would out of the box, then we'll work from there if for some reason that doesn't do the trick.

Let us know how that goes! Thanks,
-Eric

Thu, 04/09/2009 - 05:43
AMVx86

Eric,

I have ripped out virtualmin and re-installed. After doing this for about 4 times the other night, i finally got it installed and back up and running. I have done the following (to have it setup automatically for me as im completely clueless in BIND at this time).

cd /etc/bind
mv named.conf named.conf.bak

I then entered the virtualmin and gone to the servers and went into the bind settings, to have it setup as internet for me... And, yet again (with after changing to the suggested syntax you've provided -- thank you) the error persists!

Download failed : Failed to open /var/run/bind/run/named.pid /var/run/named.pid for writing : Bad file descriptor

I'm actually lost, as i've done MANY chmods on the files specified for the two pid files (folders, too), even going as far as creating them and trying again. Any suggestions?

Thank you for the help, i greatly appreciate it.

Kindest Regards,
Anthony.

Thu, 04/09/2009 - 05:49 (Reply to #7)
andreychek

Alright, so let's see where you're at -- can you run these two commands again, and paste in the output of both?

1. cat /etc/default/bind9

2. ps auxw | grep bind

Sun, 06/07/2009 - 07:50
AMVx86

Eric,

Thanks for the quick reply. Here is the output of /etc/default/bind

OPTIONS=&quot;-u bind&quot;
# Set RESOLVCONF=no to not run resolvconf
RESOLVCONF=yes

As per the listing, here we go... only returns grep as it's not running, however, when starting /etc/init.d/bind9 i get the following:

* Starting domain name service... bind
...fail!

So, now i go back into /etc/bind9/ and mv named.conf.bak to named.conf and we get the following on a bind restart...

* Starting domain name service... bind
...fail!

The contents of /etc/bind/named.conf are as follows...

options {
directory &quot;/etc/bind&quot;;
pid-file &quot;/var/run/bind/run/named.pid /var/run/named.pid&quot;;
};

I have searched for the /var/run.. named.pid files and they do not exist, so i have created them, and chmodded them restarting bind9 is... a failure as well.

I know i need bind, and i can't give it up; and i know i have to work through it... I just wish i knew more and i hate asking for help when i can't find the answers myself. I honestly appreciate the help.

Kindest Regards,
Anthony.

Sun, 06/07/2009 - 07:50
AMVx86

Eric,

Thanks for the quick reply. Here is the output of /etc/default/bind

OPTIONS=&quot;-u bind&quot;
# Set RESOLVCONF=no to not run resolvconf
RESOLVCONF=yes

As per the listing, here we go... only returns grep as it's not running, however, when starting /etc/init.d/bind9 i get the following:

* Starting domain name service... bind
...fail!

So, now i go back into /etc/bind9/ and mv named.conf.bak to named.conf and we get the following on a bind restart...

* Starting domain name service... bind
...fail!

The contents of /etc/bind/named.conf are as follows...

options {
directory &quot;/etc/bind&quot;;
pid-file &quot;/var/run/bind/run/named.pid /var/run/named.pid&quot;;
};

I have searched for the /var/run.. named.pid files and they do not exist, so i have created them, and chmodded them restarting bind9 is... a failure as well.

I know i need bind, and i can't give it up; and i know i have to work through it... I just wish i knew more and i hate asking for help when i can't find the answers myself. I honestly appreciate the help.

Kindest Regards,
Anthony.

Thu, 04/09/2009 - 06:20
andreychek

Howdy,

Well, a couple of things.

First, the pid file gets created by BIND when it's starting up, you don't need to create it. Though, the directory does need to exist.

Next, what you showed above is the contents of your /etc/bind/named.conf file? It seems to be missing a rather large number of entries there -- is that all of it? And is that the file that was put there when you reinstalled bind?

After you try to launch BIND, what do you see in /var/log/syslog? That should give you a hint as to what errors are occurring.
-Eric

Thu, 04/09/2009 - 06:26
AMVx86

Eric,

Okay here goes it. The file that i posted from the /etc/bind/named.conf file is the entire file. I have reinstalled bind (i believe when i reinstalled virtualmin).

If this is not the case, should i apt-get --purge remove bind9 &amp;&amp; apt-get install bind9 --yes?

The log entries are as follows (results taken from today):

Apr 9 10:04:43 michael kernel: [ 37.164949] TCP bind hash table entries: 16384 (order: 5, 131072 bytes)
Apr 9 10:04:43 michael kernel: [ 37.165469] TCP: Hash tables configured (established 16384 bind 16384)
Apr 9 10:04:45 michael named[4280]: starting BIND 9.4.2-P2 -u bind -t /var/lib/named
Apr 9 10:04:45 michael named[4280]: loading configuration from '/etc/bind/named.conf'
Apr 9 10:04:45 michael named[4280]: none:0: open: /etc/bind/named.conf: file not found
Apr 9 11:01:05 michael named[6821]: starting BIND 9.4.2-P2 -u bind
Apr 9 11:01:05 michael named[6821]: loading configuration from '/etc/bind/named.conf'
Apr 9 11:01:05 michael named[6821]: none:0: open: /etc/bind/named.conf: file not found
Apr 9 11:03:32 michael named[6887]: starting BIND 9.4.2-P2 -u bind
Apr 9 11:03:32 michael named[6887]: loading configuration from '/etc/bind/named.conf'
Apr 9 11:03:32 michael named[6887]: none:0: open: /etc/bind/rndc.key: file not found
Apr 9 11:03:32 michael named[6887]: none:0: open: /etc/bind/rndc.key: file not found
Apr 9 11:03:32 michael named[6887]: couldn't open pid file '/var/run/bind/run/named.pid /var/run/named.pid': No such file or directory
Apr 9 11:08:40 michael named[6991]: starting BIND 9.4.2-P2 -u bind
Apr 9 11:08:41 michael named[6991]: loading configuration from '/etc/bind/named.conf'
Apr 9 11:08:41 michael named[6991]: none:0: open: /etc/bind/rndc.key: file not found
Apr 9 11:08:41 michael named[6991]: none:0: open: /etc/bind/rndc.key: file not found
Apr 9 11:08:41 michael named[6991]: couldn't open pid file '/var/run/bind/run/named.pid /var/run/named.pid': No such file or directory
Apr 9 11:24:50 michael named[7707]: starting BIND 9.4.2-P2 -u bind
Apr 9 11:24:50 michael named[7707]: loading configuration from '/etc/bind/named.conf'
Apr 9 11:24:50 michael named[7707]: none:0: open: /etc/bind/rndc.key: file not found
Apr 9 11:24:50 michael named[7707]: none:0: open: /etc/bind/rndc.key: file not found
Apr 9 11:24:50 michael named[7707]: couldn't open pid file '/var/run/bind/run/named.pid /var/run/named.pid': No such file or directory

From what i gether, I'm missing additional files more than the named.pid files. Aren't i?

Kindest Regards,
Anthony.

Thu, 04/09/2009 - 06:39 (Reply to #12)
andreychek

Yeah, something is up with your config file :-)

I'd start here -- you have this line:

[code:1]pid-file &quot;/var/run/bind/run/named.pid /var/run/named.pid&quot;;[/code:1]

There's no need to have two pid files, and the first is what my version uses, so I'd try changing that to:

[code:1]pid-file &quot;/var/run/bind/run/named.pid&quot;;[/code:1]

However, in general, I think the issue is that the HOWTO you used may have led you astray :-)

If you do a Virtualmin install onto a supported distro (8.10 isn't supported by the installer), it actually configures everything for you out of the box, you don't end up needing to do all this tinkering.

Virtualmin doesn't support 8.10 for a reason though -- it's life cycle is too short. Ubuntu 8.04 is an LTS release (long term support), meaning it'll be supported for 5+ years.

So if you don't have your heart set on 8.10, you might find that a lot of this just works if you were using 8.04.

Otherwise, I'm sure we can get it working -- but if the above change to the BIND config doesn't work, you might want to start over with BIND by purging the config, and reinstalling it -- just to get a clean configuration file, and we can work from there.
-Eric

Thu, 04/09/2009 - 06:44
AMVx86

Dude,

BIND IS NOT STARTED UP! I have another box i can run with 8.04 I'll look into getting that up and running. Or, smack another hard disk in there and booting either one at start up.

Do you have any information on HOW to configure bind? Because when the named.conf file is missing, virtualmin doesn't create the file in the proper manor. Or would this be an 8.10 issue and i'd need to downgrade?

Thanks again for the help! I really appreciate it.

Kindest Regards,
Anthony.

Sun, 06/07/2009 - 07:50 (Reply to #14)
andreychek

Well, Virtualmin doesn't actually mess with the base BIND config, for the most part.

It's BIND itself that installs it.

On Ubuntu, all Virtualmin does when adding a Virtual Server is add a zone entry to /etc/bind/named.conf.local, and also add a new file for that domain into /etc/bind.

That's why I find the current contents of your /etc/bind/named.conf file odd. Mine (from 8.04) looks like this:

[code:1]
include &quot;/etc/bind/named.conf.options&quot;;

// prime the server with knowledge of the root servers
zone &quot;.&quot; {
type hint;
file &quot;/etc/bind/db.root&quot;;
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone &quot;localhost&quot; {
type master;
file &quot;/etc/bind/db.local&quot;;
};

zone &quot;127.in-addr.arpa&quot; {
type master;
file &quot;/etc/bind/db.127&quot;;
};

zone &quot;0.in-addr.arpa&quot; {
type master;
file &quot;/etc/bind/db.0&quot;;
};

zone &quot;255.in-addr.arpa&quot; {
type master;
file &quot;/etc/bind/db.255&quot;;
};

include &quot;/etc/bind/named.conf.local&quot;;
[/code:1]

I'm not sure that it would work to just copy that in though, I'm not sure what else is missing or not working right. But you could always try it :-)
-Eric

Thu, 04/09/2009 - 06:50
AMVx86

Eric,

Thanks for posting additional information. I will get courageous and try that lol. Another issue is that i can start bind but i can't stop it using /etc/init.d/bind9 stop. I think i will strip and then re-install. It's great when everything works, but such a b^&amp;*h when it doesn't.

If i can't get this 100% I'm doing an archive and installing 8.04. Thanks, Eric again!

Kindest Regards,
Anthony.

Topic locked